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