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

pull/10107/head
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
1 changed files with 2 additions and 2 deletions

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 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 { match mut infix_expr.left {
ast.Ident, ast.SelectorExpr { ast.Ident, ast.SelectorExpr {
if infix_expr.left.is_mut { 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 return info.typ
} else if ident.kind == .unresolved { } else if ident.kind == .unresolved {
// first use // 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) c.error('`mut` not allowed with `=` (use `:=` to declare a variable)', ident.pos)
} }
if obj := ident.scope.find(ident.name) { if obj := ident.scope.find(ident.name) {