diff options
| author | zooster <r00ster91@proton.me> | 2023-05-18 23:00:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-18 17:00:35 -0400 |
| commit | 3d64ed0353ba7ec1ca46f4779fe5d32af8d17358 (patch) | |
| tree | 71f63ffcc5da6ea49c80d3aefa095b9178dac57b /test/behavior | |
| parent | 7cf2cbb33ef34c1d211135f56d30fe23b6cacd42 (diff) | |
| download | zig-3d64ed0353ba7ec1ca46f4779fe5d32af8d17358.tar.gz zig-3d64ed0353ba7ec1ca46f4779fe5d32af8d17358.zip | |
make `@trap` return unreachable/noreturn (#15749)
`@trap` is a special function that we know never returns so it should
behave just like `@panic` and `@compileError` do currently and cause the
"unreachable code" + "control flow is diverted here" compile error.
Currently, `@trap(); @trap();` does not cause this error. Now it does.
Diffstat (limited to 'test/behavior')
| -rw-r--r-- | test/behavior/builtin_functions_returning_void_or_noreturn.zig | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/test/behavior/builtin_functions_returning_void_or_noreturn.zig b/test/behavior/builtin_functions_returning_void_or_noreturn.zig index d32215c964..ea53658888 100644 --- a/test/behavior/builtin_functions_returning_void_or_noreturn.zig +++ b/test/behavior/builtin_functions_returning_void_or_noreturn.zig @@ -26,5 +26,4 @@ test { try testing.expectEqual({}, @setEvalBranchQuota(0)); try testing.expectEqual({}, @setFloatMode(.Optimized)); try testing.expectEqual({}, @setRuntimeSafety(true)); - try testing.expectEqual(noreturn, @TypeOf(if (true) @trap() else {})); } |
