master
1export fn testFloatA() void {
2 const f: ?f32 = @import("zon/vec2.zon");
3 _ = f;
4}
5
6export fn testFloatB() void {
7 const f: *const ?f32 = @import("zon/vec2.zon");
8 _ = f;
9}
10
11export fn testFloatC() void {
12 const f: ?*const f32 = @import("zon/vec2.zon");
13 _ = f;
14}
15
16export fn testBool() void {
17 const f: ?bool = @import("zon/vec2.zon");
18 _ = f;
19}
20
21export fn testInt() void {
22 const f: ?i32 = @import("zon/vec2.zon");
23 _ = f;
24}
25
26const Enum = enum { foo };
27export fn testEnum() void {
28 const f: ?Enum = @import("zon/vec2.zon");
29 _ = f;
30}
31
32export fn testEnumLit() void {
33 const f: ?@TypeOf(.foo) = @import("zon/vec2.zon");
34 _ = f;
35}
36
37export fn testArray() void {
38 const f: ?[1]u8 = @import("zon/vec2.zon");
39 _ = f;
40}
41
42const Union = union {};
43export fn testUnion() void {
44 const f: ?Union = @import("zon/vec2.zon");
45 _ = f;
46}
47
48export fn testSlice() void {
49 const f: ?[]const u8 = @import("zon/vec2.zon");
50 _ = f;
51}
52
53export fn testVector() void {
54 const f: ?@Vector(3, f32) = @import("zon/vec2.zon");
55 _ = f;
56}
57
58// error
59// imports=zon/vec2.zon
60//
61// vec2.zon:1:2: error: expected type '?f32'
62// tmp.zig:2:29: note: imported here
63// vec2.zon:1:2: error: expected type '*const ?f32'
64// tmp.zig:7:36: note: imported here
65// vec2.zon:1:2: error: expected type '?*const f32'
66// tmp.zig:12:36: note: imported here
67// vec2.zon:1:2: error: expected type '?bool'
68// tmp.zig:17:30: note: imported here
69// vec2.zon:1:2: error: expected type '?i32'
70// tmp.zig:22:29: note: imported here
71// vec2.zon:1:2: error: expected type '?tmp.Enum'
72// tmp.zig:28:30: note: imported here
73// vec2.zon:1:2: error: expected type '?@EnumLiteral()'
74// tmp.zig:33:39: note: imported here
75// vec2.zon:1:2: error: expected type '?[1]u8'
76// tmp.zig:38:31: note: imported here
77// vec2.zon:1:2: error: expected type '?tmp.Union'
78// tmp.zig:44:31: note: imported here
79// vec2.zon:1:2: error: expected type '?[]const u8'
80// tmp.zig:49:36: note: imported here
81// vec2.zon:1:2: error: expected type '?@Vector(3, f32)'
82// tmp.zig:54:41: note: imported here