From e2ff486de5f3aceb21730e1feabbaf9b03432660 Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Sun, 27 Aug 2023 17:14:31 -0400 Subject: Sema: cleanup `coerceExtra` * remove unreachable code * remove already handled cases * avoid `InternPool.getCoerced` * add some undef checks * error when converting undef int to float Closes #16987 --- src/value.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/value.zig') diff --git a/src/value.zig b/src/value.zig index 7612a9f8c2..848da16cf8 100644 --- a/src/value.zig +++ b/src/value.zig @@ -1866,7 +1866,7 @@ pub const Value = struct { pub fn floatFromIntScalar(val: Value, float_ty: Type, mod: *Module, opt_sema: ?*Sema) !Value { return switch (mod.intern_pool.indexToKey(val.toIntern())) { - .undef => (try mod.intern(.{ .undef = float_ty.toIntern() })).toValue(), + .undef => try mod.undefValue(float_ty), .int => |int| switch (int.storage) { .big_int => |big_int| { const float = bigIntToFloat(big_int.limbs, big_int.positive); -- cgit v1.2.3