readd checker code

pull/13627/head
Kyle Lin 2022-03-03 01:11:10 +08:00 committed by Delyan Angelov
parent 3292fb0610
commit 18f1f5ea7f
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 6 additions and 0 deletions

View File

@ -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.field_name == 'len' {
node.typ = ast.int_type
return ast.int_type
}
c.error('`$unwrapped_sym.name` has no property `$node.field_name`', node.pos)
}
} else {