Sema: check for generic poison in resolveInst

This commit is contained in:
Veikka Tuominen 2022-05-25 23:09:10 +03:00
parent eba66f4a58
commit f409d925ad
2 changed files with 220 additions and 209 deletions

File diff suppressed because it is too large Load Diff

View File

@ -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');
}