Commit 5555bdca04

Andrew Kelley <andrew@ziglang.org>
2023-05-24 04:49:18
InternPool: support int->comptime_int in getCoerced
1 parent 2052260
Changed files (1)
src/InternPool.zig
@@ -3754,6 +3754,7 @@ pub fn getCoerced(ip: *InternPool, gpa: Allocator, val: Index, new_ty: Index) Al
                 .c_ulong,
                 .c_longlong,
                 .c_ulonglong,
+                .comptime_int,
                 => return getCoercedInts(ip, gpa, int, new_ty),
                 else => {},
             },
@@ -3790,6 +3791,11 @@ pub fn getCoerced(ip: *InternPool, gpa: Allocator, val: Index, new_ty: Index) Al
         },
         else => {},
     }
+    if (std.debug.runtime_safety) {
+        std.debug.panic("val={any} new_ty={any}\n", .{
+            ip.items.get(@enumToInt(val)), ip.items.get(@enumToInt(new_ty)),
+        });
+    }
     unreachable;
 }