Sema: fix coerceResultPtr

It did not handle properly when the dummy operand was a comptime_int; it
was crashing in coerce because comptime_int is supposed to be
comptime-known. So when calling coerceResultPtr, we pass the actual
operand, not a dummy operand, which means it will have the proper
comptime value when necessary.
This commit is contained in:
Andrew Kelley
2022-07-14 18:10:54 -07:00
parent d7711ec953
commit 04572f6e34
3 changed files with 39 additions and 24 deletions

View File

@@ -570,10 +570,7 @@ test "type coercion of pointer to anon struct literal to pointer to array" {
}
test "array with comptime only element type" {
const a = [_]type{
u32,
i32,
};
const a = [_]type{ u32, i32 };
try testing.expect(a[0] == u32);
try testing.expect(a[1] == i32);
}