-
-
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 behavior
Milestone
Description
Zig Version
0.14.0-dev.1550+4fba7336a
Steps to Reproduce and Observed Behavior
The following code compiles
test {
const x: ?u32 = 10;
_ = comptime if (x) x.f();
}That might cause a confusing bug in more complex cases, when the function f actually exists in x.
Expected Behavior
Like without comptime the compilation should fail with
error: expected type 'bool', found '?u32'
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior