From 63cb04196bf9dab18eecc1fd1b604f7b7d1cfe07 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Tue, 11 May 2021 13:47:49 +0300 Subject: [PATCH] Revert "ci: fix compiling comptime_if_expr_test.v" This reverts commit c5285e721729d2f1941a6fb99ba9df261d88bdd5. --- vlib/v/checker/checker.v | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index 17e341a107..5ee6b954af 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -5749,6 +5749,11 @@ pub fn (mut c Checker) if_expr(mut node ast.IfExpr) ast.Type { comptime_field_name = left.expr.str() c.comptime_fields_type[comptime_field_name] = got_type is_comptime_type_is_expr = true + } else if branch.cond.right is ast.TypeNode && left is ast.TypeNode { + // is interface + checked_type := c.unwrap_generic((left as ast.TypeNode).typ) + should_skip = !c.table.type_implements_interface(checked_type, + got_type) } else if left is ast.TypeNode { is_comptime_type_is_expr = true left_type := c.unwrap_generic(left.typ)