1
0
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:
Daniel Däschle
2020-12-10 00:59:39 +01:00
committed by GitHub
parent 4a35a75b64
commit a38fe4fca9
7 changed files with 83 additions and 33 deletions

View File

@ -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: