Sema: skip decl causing namespace lookup when doing lookup

This commit is contained in:
Veikka Tuominen
2022-06-10 00:11:46 +03:00
parent 0f820d0bdf
commit eaa6b04c3c
2 changed files with 25 additions and 0 deletions

View File

@@ -1086,3 +1086,26 @@ test "inline call of function with a switch inside the return statement" {
};
try expect(S.foo(1) == 1);
}
test "namespace lookup ignores decl causing the lookup" {
if (builtin.zig_backend == .stage1) return error.SkipZigTest;
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
const S = struct {
fn Mixin(comptime T: type) type {
return struct {
fn foo() void {
const set = std.EnumSet(T.E).init(undefined);
_ = set;
}
};
}
const E = enum { a, b };
usingnamespace Mixin(@This());
};
_ = S.foo();
}