mirror of
https://github.com/ziglang/zig.git
synced 2026-02-14 05:20:34 +00:00
relax language requirements regarding else unreachable
This commit is contained in:
parent
8bf425957b
commit
b952b84486
@ -70,7 +70,7 @@ comptime {
|
||||
_ = @import("behavior/generics.zig");
|
||||
_ = @import("behavior/hasdecl.zig");
|
||||
_ = @import("behavior/hasfield.zig");
|
||||
//_ = @import("behavior/if.zig");
|
||||
_ = @import("behavior/if.zig");
|
||||
_ = @import("behavior/import.zig");
|
||||
_ = @import("behavior/incomplete_struct_param_tld.zig");
|
||||
_ = @import("behavior/inttoptr.zig");
|
||||
|
||||
@ -72,7 +72,7 @@ test "const result loc, runtime if cond, else unreachable" {
|
||||
|
||||
var t = true;
|
||||
const x = if (t) Num.Two else unreachable;
|
||||
if (x != .Two) @compileError("bad");
|
||||
expect(x == .Two);
|
||||
}
|
||||
|
||||
test "if prongs cast to expected type instead of peer type resolution" {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user