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

v.checker: workaround for ./v wipe-cache && ./v -usecache self && ./v -usecache examples/hello_world.v errors.

This commit is contained in:
Delyan Angelov 2021-05-15 09:14:21 +03:00
parent 141248f592
commit 9fa805cbbf
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -939,7 +939,7 @@ pub fn (mut c Checker) infix_expr(mut infix_expr ast.InfixExpr) ast.Type {
}
}
mut return_type := left_type
if infix_expr.op != .key_is {
if !c.pref.use_cache && infix_expr.op != .key_is {
match mut infix_expr.left {
ast.Ident, ast.SelectorExpr {
if infix_expr.left.is_mut {
@ -5073,7 +5073,7 @@ pub fn (mut c Checker) ident(mut ident ast.Ident) ast.Type {
return info.typ
} else if ident.kind == .unresolved {
// first use
if ident.tok_kind == .assign && ident.is_mut {
if !c.pref.use_cache && ident.tok_kind == .assign && ident.is_mut {
c.error('`mut` not allowed with `=` (use `:=` to declare a variable)', ident.pos)
}
if obj := ident.scope.find(ident.name) {