| ... | ... | @@ -4738,4 +4738,20 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4738 | 4738 | , |
| 4739 | 4739 | ".tmp_source.zig:3:36: error: @ArgType could not resolve the type of arg 0 because 'fn(var)var' is generic", |
| 4740 | 4740 | ); |
| 4741 | |
| 4742 | cases.add( |
| 4743 | "@handle() called outside of function definition", |
| 4744 | \\pub fn panic(message: []const u8, stack_trace: ?*@import("builtin").StackTrace) noreturn { |
| 4745 | \\ @import("std").os.exit(126); |
| 4746 | \\} |
| 4747 | \\ |
| 4748 | \\var handle_undef: promise = undefined; |
| 4749 | \\var handle_dummy: promise = @handle(); |
| 4750 | \\ |
| 4751 | \\pub fn main() void { |
| 4752 | \\ if (handle_undef == handle_dummy) return 0; |
| 4753 | \\} |
| 4754 | , |
| 4755 | ".tmp_source.zig:6:29: error: @handle() called outside of function definition", |
| 4756 | ); |
| 4741 | 4757 | } |