1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

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

This commit is contained in:
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

View File

@ -1844,7 +1844,11 @@ pub fn (mut c Checker) assign_stmt(mut assign_stmt ast.AssignStmt) {
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)
right_type_unwrapped := c.unwrap_generic(right_type)