compiler: allow @import of ZON without a result type
In particular, this allows importing `build.zig.zon` at comptime.
This commit is contained in:
9
test/cases/compile_errors/@import_zon_anon_inf.zig
Normal file
9
test/cases/compile_errors/@import_zon_anon_inf.zig
Normal file
@@ -0,0 +1,9 @@
|
||||
export fn entry() void {
|
||||
_ = @import("zon/inf.zon");
|
||||
}
|
||||
|
||||
// error
|
||||
// imports=zon/inf.zon
|
||||
//
|
||||
// inf.zon:1:1: error: infinity requires a known result type
|
||||
// tmp.zig:2:17: note: imported here
|
||||
9
test/cases/compile_errors/@import_zon_anon_nan.zig
Normal file
9
test/cases/compile_errors/@import_zon_anon_nan.zig
Normal file
@@ -0,0 +1,9 @@
|
||||
export fn entry() void {
|
||||
_ = @import("zon/nan.zon");
|
||||
}
|
||||
|
||||
// error
|
||||
// imports=zon/nan.zon
|
||||
//
|
||||
// nan.zon:1:1: error: NaN requires a known result type
|
||||
// tmp.zig:2:17: note: imported here
|
||||
9
test/cases/compile_errors/@import_zon_anon_neg_inf.zig
Normal file
9
test/cases/compile_errors/@import_zon_anon_neg_inf.zig
Normal file
@@ -0,0 +1,9 @@
|
||||
export fn entry() void {
|
||||
_ = @import("zon/neg_inf.zon");
|
||||
}
|
||||
|
||||
// error
|
||||
// imports=zon/neg_inf.zon
|
||||
//
|
||||
// neg_inf.zon:1:1: error: negative infinity requires a known result type
|
||||
// tmp.zig:2:17: note: imported here
|
||||
@@ -1,9 +0,0 @@
|
||||
export fn entry() void {
|
||||
const f = @import("zon/simple_union.zon");
|
||||
_ = f;
|
||||
}
|
||||
|
||||
// error
|
||||
// imports=zon/simple_union.zon
|
||||
//
|
||||
// tmp.zig:2:23: error: '@import' of ZON must have a known result type
|
||||
Reference in New Issue
Block a user