ast: fix error for 'for smartcast' - part 2 (#13635)
parent
ffe6ff3cc8
commit
36e80266e6
|
@ -269,8 +269,8 @@ pub fn (e &SelectorExpr) root_ident() ?Ident {
|
||||||
for mut root is SelectorExpr {
|
for mut root is SelectorExpr {
|
||||||
root = root.expr
|
root = root.expr
|
||||||
}
|
}
|
||||||
if root is Ident {
|
if mut root is Ident {
|
||||||
return root as Ident
|
return root
|
||||||
}
|
}
|
||||||
|
|
||||||
return none
|
return none
|
||||||
|
|
|
@ -1489,9 +1489,8 @@ pub fn (mut t Table) resolve_generic_to_concrete(generic_type Type, generic_name
|
||||||
mut elem_type := sym.info.elem_type
|
mut elem_type := sym.info.elem_type
|
||||||
mut elem_sym := t.sym(elem_type)
|
mut elem_sym := t.sym(elem_type)
|
||||||
mut dims := 1
|
mut dims := 1
|
||||||
for elem_sym.info is Array {
|
for mut elem_sym.info is Array {
|
||||||
info := elem_sym.info as Array
|
elem_type = elem_sym.info.elem_type
|
||||||
elem_type = info.elem_type
|
|
||||||
elem_sym = t.sym(elem_type)
|
elem_sym = t.sym(elem_type)
|
||||||
dims++
|
dims++
|
||||||
}
|
}
|
||||||
|
@ -1646,9 +1645,8 @@ pub fn (mut t Table) unwrap_generic_type(typ Type, generic_names []string, concr
|
||||||
mut elem_type := ts.info.elem_type
|
mut elem_type := ts.info.elem_type
|
||||||
mut elem_sym := t.sym(elem_type)
|
mut elem_sym := t.sym(elem_type)
|
||||||
mut dims := 1
|
mut dims := 1
|
||||||
for elem_sym.info is Array {
|
for mut elem_sym.info is Array {
|
||||||
info := elem_sym.info as Array
|
elem_type = elem_sym.info.elem_type
|
||||||
elem_type = info.elem_type
|
|
||||||
elem_sym = t.sym(elem_type)
|
elem_sym = t.sym(elem_type)
|
||||||
dims++
|
dims++
|
||||||
}
|
}
|
||||||
|
@ -1857,9 +1855,8 @@ pub fn (mut t Table) replace_generic_type(typ Type, generic_types []Type) {
|
||||||
mut elem_type := ts.info.elem_type
|
mut elem_type := ts.info.elem_type
|
||||||
mut elem_sym := t.sym(elem_type)
|
mut elem_sym := t.sym(elem_type)
|
||||||
mut dims := 1
|
mut dims := 1
|
||||||
for elem_sym.info is Array {
|
for mut elem_sym.info is Array {
|
||||||
info := elem_sym.info as Array
|
elem_type = elem_sym.info.elem_type
|
||||||
elem_type = info.elem_type
|
|
||||||
elem_sym = t.sym(elem_type)
|
elem_sym = t.sym(elem_type)
|
||||||
dims++
|
dims++
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue