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
This commit is contained in:
committed by
Andrew Kelley
parent
49075d2055
commit
e2ff486de5
@@ -6360,7 +6360,7 @@ pub fn errorSetFromUnsortedNames(
|
||||
|
||||
/// Supports only pointers, not pointer-like optionals.
|
||||
pub fn ptrIntValue(mod: *Module, ty: Type, x: u64) Allocator.Error!Value {
|
||||
assert(ty.zigTypeTag(mod) == .Pointer);
|
||||
assert(ty.zigTypeTag(mod) == .Pointer and !ty.isSlice(mod));
|
||||
const i = try intern(mod, .{ .ptr = .{
|
||||
.ty = ty.toIntern(),
|
||||
.addr = .{ .int = (try mod.intValue_u64(Type.usize, x)).toIntern() },
|
||||
|
||||
Reference in New Issue
Block a user