fmt: fix removal of `Abc` in `import mod { Abc }`, where Abc is used in a `x is Abc` expression (#10286)
parent
cb19079d53
commit
90292ce981
|
@ -2429,6 +2429,7 @@ pub fn (mut f Fmt) string_inter_literal(node ast.StringInterLiteral) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn (mut f Fmt) type_expr(node ast.TypeNode) {
|
pub fn (mut f Fmt) type_expr(node ast.TypeNode) {
|
||||||
|
f.mark_types_import_as_used(node.typ)
|
||||||
f.write(f.table.type_to_str_using_aliases(node.typ, f.mod2alias))
|
f.write(f.table.type_to_str_using_aliases(node.typ, f.mod2alias))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ import mod {
|
||||||
InterfaceField,
|
InterfaceField,
|
||||||
InterfaceMethodArg,
|
InterfaceMethodArg,
|
||||||
InterfaceMethodRet,
|
InterfaceMethodRet,
|
||||||
|
RightOfIs,
|
||||||
StructEmbed,
|
StructEmbed,
|
||||||
StructField,
|
StructField,
|
||||||
StructMethodArg,
|
StructMethodArg,
|
||||||
|
@ -34,6 +35,9 @@ interface Interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn f(v FnArg) FnRet {
|
fn f(v FnArg) FnRet {
|
||||||
|
if v is RightOfIs {
|
||||||
|
}
|
||||||
|
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,8 @@ import mod {
|
||||||
|
|
||||||
FnArg,
|
FnArg,
|
||||||
FnRet,
|
FnRet,
|
||||||
|
|
||||||
|
RightOfIs,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Struct {
|
struct Struct {
|
||||||
|
@ -37,6 +39,8 @@ interface Interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn f(v FnArg) FnRet {
|
fn f(v FnArg) FnRet {
|
||||||
|
if v is RightOfIs {}
|
||||||
|
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue