| ... | @@ -1,125 +0,0 @@ |
| 1 | export fn testVoid() void { |
| 2 | const f: void = @import("zon/neg_inf.zon"); |
| 3 | _ = f; |
| 4 | } |
| 5 | |
| 6 | export fn testInStruct() void { |
| 7 | const f: struct { f: [*]const u8 } = @import("zon/neg_inf.zon"); |
| 8 | _ = f; |
| 9 | } |
| 10 | |
| 11 | export fn testError() void { |
| 12 | const f: struct { error{foo} } = @import("zon/neg_inf.zon"); |
| 13 | _ = f; |
| 14 | } |
| 15 | |
| 16 | export fn testInUnion() void { |
| 17 | const f: union(enum) { a: void, b: [*c]const u8 } = @import("zon/neg_inf.zon"); |
| 18 | _ = f; |
| 19 | } |
| 20 | |
| 21 | export fn testInVector() void { |
| 22 | const f: @Vector(0, [*c]const u8) = @import("zon/neg_inf.zon"); |
| 23 | _ = f; |
| 24 | } |
| 25 | |
| 26 | export fn testInOpt() void { |
| 27 | const f: *const ?[*c]const u8 = @import("zon/neg_inf.zon"); |
| 28 | _ = f; |
| 29 | } |
| 30 | |
| 31 | export fn testComptimeField() void { |
| 32 | const f: struct { comptime foo: ??u8 = null } = @import("zon/neg_inf.zon"); |
| 33 | _ = f; |
| 34 | } |
| 35 | |
| 36 | export fn testEnumLiteral() void { |
| 37 | const f: @TypeOf(.foo) = @import("zon/neg_inf.zon"); |
| 38 | _ = f; |
| 39 | } |
| 40 | |
| 41 | export fn testNestedOpt1() void { |
| 42 | const f: ??u8 = @import("zon/neg_inf.zon"); |
| 43 | _ = f; |
| 44 | } |
| 45 | |
| 46 | export fn testNestedOpt2() void { |
| 47 | const f: ?*const ?u8 = @import("zon/neg_inf.zon"); |
| 48 | _ = f; |
| 49 | } |
| 50 | |
| 51 | export fn testNestedOpt3() void { |
| 52 | const f: *const ?*const ?*const u8 = @import("zon/neg_inf.zon"); |
| 53 | _ = f; |
| 54 | } |
| 55 | |
| 56 | export fn testOpt() void { |
| 57 | const f: ?u8 = @import("zon/neg_inf.zon"); |
| 58 | _ = f; |
| 59 | } |
| 60 | |
| 61 | export fn testNonExhaustiveEnum() void { |
| 62 | const f: enum(u8) { _ } = @import("zon/neg_inf.zon"); |
| 63 | _ = f; |
| 64 | } |
| 65 | |
| 66 | export fn testUntaggedUnion() void { |
| 67 | const f: union { foo: void } = @import("zon/neg_inf.zon"); |
| 68 | _ = f; |
| 69 | } |
| 70 | |
| 71 | export fn testTaggedUnionVoid() void { |
| 72 | const f: union(enum) { foo: void } = @import("zon/neg_inf.zon"); |
| 73 | _ = f; |
| 74 | } |
| 75 | |
| 76 | export fn testVisited() void { |
| 77 | const V = struct { |
| 78 | ?f32, // Adds `?f32` to the visited list |
| 79 | ??f32, // `?f32` is already visited, we need to detect the nested opt anyway |
| 80 | f32, |
| 81 | }; |
| 82 | const f: V = @import("zon/neg_inf.zon"); |
| 83 | _ = f; |
| 84 | } |
| 85 | |
| 86 | export fn testMutablePointer() void { |
| 87 | const f: *i32 = @import("zon/neg_inf.zon"); |
| 88 | _ = f; |
| 89 | } |
| 90 | |
| 91 | // error |
| 92 | // imports=zon/neg_inf.zon |
| 93 | // |
| 94 | // tmp.zig:2:29: error: type 'void' is not available in ZON |
| 95 | // tmp.zig:7:50: error: type '[*]const u8' is not available in ZON |
| 96 | // tmp.zig:7:50: note: ZON does not allow many-pointers |
| 97 | // tmp.zig:12:46: error: type 'error{foo}' is not available in ZON |
| 98 | // tmp.zig:17:65: error: type '[*c]const u8' is not available in ZON |
| 99 | // tmp.zig:17:65: note: ZON does not allow C pointers |
| 100 | // tmp.zig:22:49: error: type '[*c]const u8' is not available in ZON |
| 101 | // tmp.zig:22:49: note: ZON does not allow C pointers |
| 102 | // tmp.zig:27:45: error: type '[*c]const u8' is not available in ZON |
| 103 | // tmp.zig:27:45: note: ZON does not allow C pointers |
| 104 | // tmp.zig:32:61: error: type '??u8' is not available in ZON |
| 105 | // tmp.zig:32:61: note: ZON does not allow nested optionals |
| 106 | // tmp.zig:42:29: error: type '??u8' is not available in ZON |
| 107 | // tmp.zig:42:29: note: ZON does not allow nested optionals |
| 108 | // tmp.zig:47:36: error: type '?*const ?u8' is not available in ZON |
| 109 | // tmp.zig:47:36: note: ZON does not allow nested optionals |
| 110 | // tmp.zig:52:50: error: type '?*const ?*const u8' is not available in ZON |
| 111 | // tmp.zig:52:50: note: ZON does not allow nested optionals |
| 112 | // tmp.zig:82:26: error: type '??f32' is not available in ZON |
| 113 | // tmp.zig:82:26: note: ZON does not allow nested optionals |
| 114 | // tmp.zig:87:29: error: type '*i32' is not available in ZON |
| 115 | // tmp.zig:87:29: note: ZON does not allow mutable pointers |
| 116 | // neg_inf.zon:1:1: error: expected type '@Type(.enum_literal)' |
| 117 | // tmp.zig:37:38: note: imported here |
| 118 | // neg_inf.zon:1:1: error: expected type '?u8' |
| 119 | // tmp.zig:57:28: note: imported here |
| 120 | // neg_inf.zon:1:1: error: expected type 'tmp.testNonExhaustiveEnum__enum_525' |
| 121 | // tmp.zig:62:39: note: imported here |
| 122 | // neg_inf.zon:1:1: error: expected type 'tmp.testUntaggedUnion__union_527' |
| 123 | // tmp.zig:67:44: note: imported here |
| 124 | // neg_inf.zon:1:1: error: expected type 'tmp.testTaggedUnionVoid__union_530' |
| 125 | // tmp.zig:72:50: note: imported here |