aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2020-11-20 16:38:00 +0100
committerAndrew Kelley <andrew@ziglang.org>2020-11-20 17:01:23 -0800
commit6029114f84ea7ddbf0e40db6ee9b7c1ab4e86b95 (patch)
tree39f44264975d9fb2ed761e5ab1d17a7c53afdaef /test
parent73be59433f36f5a8f5c7fa7bbffcb8eb17b1735d (diff)
downloadzig-6029114f84ea7ddbf0e40db6ee9b7c1ab4e86b95.tar.gz
zig-6029114f84ea7ddbf0e40db6ee9b7c1ab4e86b95.zip
stage1: Resolve usingnamespace decls when calling @typeInfo
Closes #7176
Diffstat (limited to 'test')
-rw-r--r--test/stage1/behavior/type_info.zig14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/stage1/behavior/type_info.zig b/test/stage1/behavior/type_info.zig
index b19a404e25..fda79e71d2 100644
--- a/test/stage1/behavior/type_info.zig
+++ b/test/stage1/behavior/type_info.zig
@@ -460,3 +460,17 @@ test "StructField.is_comptime" {
expect(!info.fields[0].is_comptime);
expect(info.fields[1].is_comptime);
}
+
+test "typeInfo resolves usingnamespace declarations" {
+ const A = struct {
+ pub const f1 = 42;
+ };
+
+ const B = struct {
+ const f0 = 42;
+ usingnamespace A;
+ };
+
+ expect(@typeInfo(B).Struct.decls.len == 2);
+ //a
+}