Skip to content

Commit

Permalink
fix cases i broke
Browse files Browse the repository at this point in the history
  • Loading branch information
mlugg committed Feb 2, 2025
1 parent 2f5fccb commit 4b76885
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 44 deletions.
52 changes: 25 additions & 27 deletions test/cases/compile_errors/@import_zon_bad_type.zig
Original file line number Diff line number Diff line change
Expand Up @@ -91,37 +91,35 @@ export fn testMutablePointer() void {
// error
// imports=zon/neg_inf.zon
//
// tmp.zig:2:29: error: result type not available in ZON
// tmp.zig:2:29: note: result type contains type 'void'
// tmp.zig:7:50: error: many item pointers not available in ZON
// tmp.zig:7:50: note: result type contains type '[*]const u8'
// tmp.zig:12:46: error: result type not available in ZON
// tmp.zig:12:46: note: result type contains type 'error{foo}'
// tmp.zig:17:65: error: c pointers not available in ZON
// tmp.zig:17:65: note: result type contains type '[*c]const u8'
// tmp.zig:22:49: error: c pointers not available in ZON
// tmp.zig:22:49: note: result type contains type '[*c]const u8'
// tmp.zig:27:45: error: c pointers not available in ZON
// tmp.zig:27:45: note: result type contains type '[*c]const u8'
// tmp.zig:32:61: error: nested optionals not available in ZON
// tmp.zig:32:61: note: result type contains type '??u8'
// tmp.zig:42:29: error: nested optionals not available in ZON
// tmp.zig:42:29: note: result type contains type '??u8'
// tmp.zig:47:36: error: nested optionals not available in ZON
// tmp.zig:47:36: note: result type contains type '?*const ?u8'
// tmp.zig:52:50: error: nested optionals not available in ZON
// tmp.zig:52:50: note: result type contains type '?*const ?*const u8'
// tmp.zig:82:26: error: nested optionals not available in ZON
// tmp.zig:82:26: note: result type contains type '??f32'
// tmp.zig:87:29: error: mutable pointers not available in import ZON
// tmp.zig:87:29: note: result type contains type '*i32'
// tmp.zig:2:29: error: type 'void' is not available in ZON
// tmp.zig:7:50: error: type '[*]const u8' is not available in ZON
// tmp.zig:7:50: note: ZON does not allow many-pointers
// tmp.zig:12:46: error: type 'error{foo}' is not available in ZON
// tmp.zig:17:65: error: type '[*c]const u8' is not available in ZON
// tmp.zig:17:65: note: ZON does not allow C pointers
// tmp.zig:22:49: error: type '[*c]const u8' is not available in ZON
// tmp.zig:22:49: note: ZON does not allow C pointers
// tmp.zig:27:45: error: type '[*c]const u8' is not available in ZON
// tmp.zig:27:45: note: ZON does not allow C pointers
// tmp.zig:32:61: error: type '??u8' is not available in ZON
// tmp.zig:32:61: note: ZON does not allow nested optionals
// tmp.zig:42:29: error: type '??u8' is not available in ZON
// tmp.zig:42:29: note: ZON does not allow nested optionals
// tmp.zig:47:36: error: type '?*const ?u8' is not available in ZON
// tmp.zig:47:36: note: ZON does not allow nested optionals
// tmp.zig:52:50: error: type '?*const ?*const u8' is not available in ZON
// tmp.zig:52:50: note: ZON does not allow nested optionals
// tmp.zig:82:26: error: type '??f32' is not available in ZON
// tmp.zig:82:26: note: ZON does not allow nested optionals
// tmp.zig:87:29: error: type '*i32' is not available in ZON
// tmp.zig:87:29: note: ZON does not allow mutable pointers
// neg_inf.zon:1:1: error: expected type '@Type(.enum_literal)'
// tmp.zig:37:38: note: imported here
// neg_inf.zon:1:1: error: expected type '?u8'
// tmp.zig:57:28: note: imported here
// neg_inf.zon:1:1: error: expected type 'tmp.testNonExhaustiveEnum__enum_489'
// neg_inf.zon:1:1: error: expected type 'tmp.testNonExhaustiveEnum__enum_490'
// tmp.zig:62:39: note: imported here
// neg_inf.zon:1:1: error: expected type 'tmp.testUntaggedUnion__union_491'
// neg_inf.zon:1:1: error: expected type 'tmp.testUntaggedUnion__union_492'
// tmp.zig:67:44: note: imported here
// neg_inf.zon:1:1: error: expected type 'tmp.testTaggedUnionVoid__union_494'
// neg_inf.zon:1:1: error: expected type 'tmp.testTaggedUnionVoid__union_495'
// tmp.zig:72:50: note: imported here
27 changes: 10 additions & 17 deletions test/cases/compile_errors/@import_zon_opt_in_err.zig
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ export fn testFloatC() void {
_ = f;
}

export fn testFloatD() void {
const f: ?*const f32 = @import("zon/vec2.zon");
_ = f;
}

export fn testBool() void {
const f: ?bool = @import("zon/vec2.zon");
_ = f;
Expand Down Expand Up @@ -65,25 +60,23 @@ export fn testVector() void {
//
// vec2.zon:1:2: error: expected type '?f32'
// tmp.zig:2:29: note: imported here
// vec2.zon:1:2: error: expected type '?f32'
// vec2.zon:1:2: error: expected type '*const ?f32'
// tmp.zig:7:36: note: imported here
// vec2.zon:1:2: error: expected type '?f32'
// vec2.zon:1:2: error: expected type '?*const f32'
// tmp.zig:12:36: note: imported here
// vec2.zon:1:2: error: expected type '?f32'
// tmp.zig:17:36: note: imported here
// vec2.zon:1:2: error: expected type '?bool'
// tmp.zig:22:30: note: imported here
// tmp.zig:17:30: note: imported here
// vec2.zon:1:2: error: expected type '?i32'
// tmp.zig:27:29: note: imported here
// tmp.zig:22:29: note: imported here
// vec2.zon:1:2: error: expected type '?tmp.Enum'
// tmp.zig:33:30: note: imported here
// tmp.zig:28:30: note: imported here
// vec2.zon:1:2: error: expected type '?@Type(.enum_literal)'
// tmp.zig:38:39: note: imported here
// tmp.zig:33:39: note: imported here
// vec2.zon:1:2: error: expected type '?[1]u8'
// tmp.zig:43:31: note: imported here
// tmp.zig:38:31: note: imported here
// vec2.zon:1:2: error: expected type '?tmp.Union'
// tmp.zig:49:31: note: imported here
// tmp.zig:44:31: note: imported here
// vec2.zon:1:2: error: expected type '?[]const u8'
// tmp.zig:54:36: note: imported here
// tmp.zig:49:36: note: imported here
// vec2.zon:1:2: error: expected type '?@Vector(3, f32)'
// tmp.zig:59:41: note: imported here
// tmp.zig:54:41: note: imported here

0 comments on commit 4b76885

Please sign in to comment.