From 9fa805cbbf9525ab2e4f8fdce1d62c1f494ee0fb Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sat, 15 May 2021 09:14:21 +0300 Subject: [PATCH] v.checker: workaround for `./v wipe-cache && ./v -usecache self && ./v -usecache examples/hello_world.v` errors. --- vlib/v/checker/checker.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index 72cbd09cc8..03aa2b3725 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -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) {