checker: fix error declaration on a value (#6390)

pull/6393/head
Henrixounez 2020-09-16 22:01:15 +02:00 committed by GitHub
parent e2e683199d
commit 608df40058
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -1844,7 +1844,11 @@ pub fn (mut c Checker) assign_stmt(mut assign_stmt ast.AssignStmt) {
assign_stmt.pos) assign_stmt.pos)
} }
} }
else {} else {
if is_decl {
c.error('non-name `$left` on left side of `:=`', left.position())
}
}
} }
left_type_unwrapped := c.unwrap_generic(left_type) left_type_unwrapped := c.unwrap_generic(left_type)
right_type_unwrapped := c.unwrap_generic(right_type) right_type_unwrapped := c.unwrap_generic(right_type)