-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.miscompilationThe compiler reports success but produces semantically incorrect code.The compiler reports success but produces semantically incorrect code.
Milestone
Description
Zig Version: 0.10.0-dev.2992+1fee9eac8
test "else continue outer while" {
var i: usize = 0;
while (true) {
i += 1;
while (i > 5) {
return;
} else continue;
}
}Expected to pass; instead infinitely loops.
This is the root cause of
Lines 106 to 107 in 1fee9ea
| test "resolve DNS" { | |
| if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; |
For loops have the same problem:
test "else continue outer for" {
var i: usize = 6;
var buf: [5]u8 = undefined;
while (true) {
i -= 1;
for (buf[i..5]) |_| {
return;
} else continue;
}
}Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.miscompilationThe compiler reports success but produces semantically incorrect code.The compiler reports success but produces semantically incorrect code.