From 0b95d72354a78ea240a4e1bb0fb2708bf74d40a8 Mon Sep 17 00:00:00 2001 From: spaceface777 Date: Fri, 25 Sep 2020 11:48:27 +0200 Subject: [PATCH] checker: comp. if branch logic fix (#6473) --- 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 6b69112689..99fd006655 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -3423,12 +3423,12 @@ fn (mut c Checker) comp_if_branch(cond ast.Expr, pos token.Position) bool { .and { l := c.comp_if_branch(cond.left, cond.pos) r := c.comp_if_branch(cond.right, cond.pos) - return l && r + return l || r // skip (return true) if at least one should be skipped } .logical_or { l := c.comp_if_branch(cond.left, cond.pos) r := c.comp_if_branch(cond.right, cond.pos) - return l || r + return l && r // skip (return true) only if both should be skipped } .key_is, .not_is { // $if method.@type is string