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 as Abc
expression #10306
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import v.ast
|
||||
import v.ast { InfixExpr }
|
||||
import v.table
|
||||
|
||||
fn test_as() {
|
||||
|
@ -11,6 +11,7 @@ import mod {
|
||||
InterfaceField,
|
||||
InterfaceMethodArg,
|
||||
InterfaceMethodRet,
|
||||
RightOfAs,
|
||||
RightOfIs,
|
||||
StructEmbed,
|
||||
StructField,
|
||||
@ -37,6 +38,7 @@ interface Interface {
|
||||
fn f(v FnArg) FnRet {
|
||||
if v is RightOfIs {
|
||||
}
|
||||
_ = v as RightOfAs
|
||||
|
||||
return {}
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ import mod {
|
||||
FnRet,
|
||||
|
||||
RightOfIs,
|
||||
RightOfAs,
|
||||
}
|
||||
|
||||
struct Struct {
|
||||
@ -40,6 +41,7 @@ interface Interface {
|
||||
|
||||
fn f(v FnArg) FnRet {
|
||||
if v is RightOfIs {}
|
||||
_ = v as RightOfAs
|
||||
|
||||
return {}
|
||||
}
|
||||
|
Reference in New Issue
Block a user