We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d0a1608 commit 55951e0Copy full SHA for 55951e0
vlib/v/checker/if.v
@@ -274,11 +274,7 @@ pub fn (mut c Checker) if_expr(mut node ast.IfExpr) ast.Type {
274
}
275
276
// if only untyped literals were given default to int/f64
277
- if node.typ == ast.int_literal_type {
278
- node.typ = ast.int_type
279
- } else if node.typ == ast.float_literal_type {
280
- node.typ = ast.f64_type
281
- }
+ node.typ = ast.mktyp(node.typ)
282
if expr_required && !node.has_else {
283
d := if node.is_comptime { '$' } else { '' }
284
c.error('`$if_kind` expression needs `${d}else` clause', node.pos)
0 commit comments