-
Notifications
You must be signed in to change notification settings - Fork 153
Closed
Description
Run this with verus:
use builtin_macros::verus;
verus!{
exec fn foo(a: usize, b: usize, c: usize) -> usize {
if a <= b <= c { 1 } else { 2 }
}
}You'll get error: condition must have mode exec, which is quite confusing.
A workaround is to replace the condition with a <= b && b <= c, so evidently operator chaining causes the expression to suddenly become a spec expression.
Is there any reason we shouldn't allow chained expressions in exec text and desugar them to a collection of conjuncts?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels