From bff90d0e9d0096dc8a847a23692990366cf2880d Mon Sep 17 00:00:00 2001 From: yuyi Date: Tue, 21 Jan 2025 19:46:16 +0800 Subject: [PATCH] checker: minor cleanup in smartcast_if_conds() (#23542) --- vlib/v/checker/if.v | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vlib/v/checker/if.v b/vlib/v/checker/if.v index 9415b1847a6ec6..3ae6d391a64dfb 100644 --- a/vlib/v/checker/if.v +++ b/vlib/v/checker/if.v @@ -675,8 +675,7 @@ fn (mut c Checker) smartcast_if_conds(mut node ast.Expr, mut scope ast.Scope, co // handles unwrapping on if var == none { /**/ } else { /*unwrapped var*/ } if mut first_cond is ast.InfixExpr { if first_cond.left is ast.Ident && first_cond.op == .eq && first_cond.right is ast.None { - if first_cond.left is ast.Ident - && c.comptime.get_ct_type_var(first_cond.left) == .smartcast { + if c.comptime.get_ct_type_var(first_cond.left) == .smartcast { first_cond.left_type = c.type_resolver.get_type(first_cond.left) c.smartcast(mut first_cond.left, first_cond.left_type, first_cond.left_type.clear_flag(.option), mut scope, true, true)