Fix #13626, check unwrapped type is fixed array and selector expr is 'len'
parent
996bd41ce8
commit
1486ba9760
|
|
@ -1667,6 +1667,12 @@ pub fn (mut c Checker) selector_expr(mut node ast.SelectorExpr) ast.Type {
|
|||
if sym.kind !in [.struct_, .aggregate, .interface_, .sum_type] {
|
||||
if sym.kind != .placeholder {
|
||||
unwrapped_sym := c.table.sym(c.unwrap_generic(typ))
|
||||
|
||||
if unwrapped_sym.kind == .array_fixed {
|
||||
node.typ = ast.int_type
|
||||
return ast.int_type
|
||||
}
|
||||
|
||||
c.error('`$unwrapped_sym.name` has no property `$node.field_name`', node.pos)
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue