-
-
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.
Milestone
Description
test {
const S = struct {
fn foo() !u8 {
return error.Foo;
}
};
const value = S.foo() catch |err| switch (err) {
error.Foo => 255,
};
try expect(value == 255);
}a.zig:14:39: error: value with comptime only type 'comptime_int' depends on runtime control flow
const value = S.foo() catch |err| switch (err) {
^
a.zig:14:47: note: runtime control flow here
const value = S.foo() catch |err| switch (err) {
^
Reactions are currently unavailable
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.