1#exe {
2-Mroot=main.zig
3#}
4
5#write main.zig {
6const T = @import("foo.zig").T;
7pub fn main() void {
8 @compileLog(T);
9 @compileLog(@tagName(@typeInfo(T)));
10}
11#}
12#write foo.zig {
13pub const T = struct { x: u8 };
14#}
15#update "T is struct"
16#check errors {
17main.zig:3:5: error: found compile log statement
18
19Compile Log Output:
20@as(type, foo.T)
21@as(*const [6:0]u8, "struct")
22#}
23
24#write foo.zig {
25pub const T = union {};
26#}
27#update "T is union"
28#check errors {
29main.zig:3:5: error: found compile log statement
30
31Compile Log Output:
32@as(type, foo.T)
33@as(*const [5:0]u8, "union")
34#}
35
36#write foo.zig {
37pub const T = enum {};
38#}
39#update "T is enum"
40#check errors {
41main.zig:3:5: error: found compile log statement
42
43Compile Log Output:
44@as(type, foo.T)
45@as(*const [4:0]u8, "enum")
46#}
47
48#write foo.zig {
49pub const T = opaque {};
50#}
51#update "T is opaque"
52#check errors {
53main.zig:3:5: error: found compile log statement
54
55Compile Log Output:
56@as(type, foo.T)
57@as(*const [6:0]u8, "opaque")
58#}
59
60#write foo.zig {
61pub const T = packed struct {};
62#}
63#update "T is packed struct"
64#check errors {
65main.zig:3:5: error: found compile log statement
66
67Compile Log Output:
68@as(type, foo.T)
69@as(*const [6:0]u8, "struct")
70#}
71
72#write foo.zig {
73pub const T = packed union { x: void }; // packed unions need at least 1 field
74#}
75#update "T is packed union"
76#check errors {
77main.zig:3:5: error: found compile log statement
78
79Compile Log Output:
80@as(type, foo.T)
81@as(*const [5:0]u8, "union")
82#}
83
84#write foo.zig {
85pub const T = extern struct {};
86#}
87#update "T is extern struct"
88#check errors {
89main.zig:3:5: error: found compile log statement
90
91Compile Log Output:
92@as(type, foo.T)
93@as(*const [6:0]u8, "struct")
94#}
95
96#write foo.zig {
97pub const T = extern union { x: void }; // extern unions need at least 1 field
98#}
99#update "T is extern union"
100#check errors {
101main.zig:3:5: error: found compile log statement
102
103Compile Log Output:
104@as(type, foo.T)
105@as(*const [5:0]u8, "union")
106#}