aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/basic.zig
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2022-06-10 00:11:46 +0300
committerVeikka Tuominen <git@vexu.eu>2022-06-11 11:02:56 +0300
commiteaa6b04c3cb8073d5a1510560ec8f1e433984895 (patch)
tree4e65cd3c8cb3d37b7037a8c92b65ca4b752113eb /test/behavior/basic.zig
parent0f820d0bdf98b3f8429a9cf2f1b405c2c0a4d958 (diff)
downloadzig-eaa6b04c3cb8073d5a1510560ec8f1e433984895.tar.gz
zig-eaa6b04c3cb8073d5a1510560ec8f1e433984895.zip
Sema: skip decl causing namespace lookup when doing lookup
Diffstat (limited to 'test/behavior/basic.zig')
-rw-r--r--test/behavior/basic.zig23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/behavior/basic.zig b/test/behavior/basic.zig
index a69df862c1..ac9d90d5e6 100644
--- a/test/behavior/basic.zig
+++ b/test/behavior/basic.zig
@@ -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();
+}