mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fmt: fix removal of Abc
in import mod { Abc }
, where Abc is used in a x is Abc
expression (#10286)
This commit is contained in:
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) {
|
||||
f.mark_types_import_as_used(node.typ)
|
||||
f.write(f.table.type_to_str_using_aliases(node.typ, f.mod2alias))
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,7 @@ import mod {
|
||||
InterfaceField,
|
||||
InterfaceMethodArg,
|
||||
InterfaceMethodRet,
|
||||
RightOfIs,
|
||||
StructEmbed,
|
||||
StructField,
|
||||
StructMethodArg,
|
||||
@ -34,6 +35,9 @@ interface Interface {
|
||||
}
|
||||
|
||||
fn f(v FnArg) FnRet {
|
||||
if v is RightOfIs {
|
||||
}
|
||||
|
||||
return {}
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,8 @@ import mod {
|
||||
|
||||
FnArg,
|
||||
FnRet,
|
||||
|
||||
RightOfIs,
|
||||
}
|
||||
|
||||
struct Struct {
|
||||
@ -37,6 +39,8 @@ interface Interface {
|
||||
}
|
||||
|
||||
fn f(v FnArg) FnRet {
|
||||
if v is RightOfIs {}
|
||||
|
||||
return {}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user