mirror of
https://github.com/ziglang/zig.git
synced 2026-12-05 19:28:46 -05:00
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:
1 parent
49075d2055
commit
e2ff486de5
5 files changed
+102
-99
No files matched your search
+1
-1
@@ -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