mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: fix smartcast inside smartcast (#7215)
This commit is contained in:
@ -114,6 +114,16 @@ pub mut:
|
||||
name_type table.Type // T in `T.name` or typeof in `typeof(expr).name`
|
||||
}
|
||||
|
||||
// root_ident returns the origin ident where the selector started.
|
||||
pub fn (e &SelectorExpr) root_ident() Ident {
|
||||
mut root := e.expr
|
||||
for root is SelectorExpr {
|
||||
selector_expr := root as SelectorExpr
|
||||
root = selector_expr.expr
|
||||
}
|
||||
return root as Ident
|
||||
}
|
||||
|
||||
// module declaration
|
||||
pub struct Module {
|
||||
pub:
|
||||
|
Reference in New Issue
Block a user