Sema: resolve union fields before using getTagType

Closes #13649
This commit is contained in:
Veikka Tuominen
2022-11-25 02:40:06 +02:00
parent bf62cb453b
commit 587ef60a28
2 changed files with 20 additions and 2 deletions

View File

@@ -0,0 +1,16 @@
const T = union(enum) {
a,
pub fn f(self: T) void {
_ = self;
}
};
pub export fn entry() void {
T.a.f();
}
// error
// backend=stage2
// target=native
//
// :8:8: error: no field or member function named 'f' in '@typeInfo(tmp.T).Union.tag_type.?'
// :1:11: note: enum declared here