mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
Sema: check for generic poison in resolveInst
This commit is contained in:
parent
eba66f4a58
commit
f409d925ad
419
src/Sema.zig
419
src/Sema.zig
File diff suppressed because it is too large
Load Diff
@ -290,3 +290,13 @@ test "hardcoded address in typeof expression" {
|
||||
try expect(S.func() == 0);
|
||||
comptime try expect(S.func() == 0);
|
||||
}
|
||||
|
||||
test "array access of generic param in typeof expression" {
|
||||
const S = struct {
|
||||
fn first(comptime items: anytype) @TypeOf(items[0]) {
|
||||
return items[0];
|
||||
}
|
||||
};
|
||||
try expect(S.first("a") == 'a');
|
||||
comptime try expect(S.first("a") == 'a');
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user