You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RustanLeino opened this issue
Feb 2, 2024
· 0 comments
Labels
area: error-reportingClarity of the error reportingkind: enhancementEnhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny
Dafny makes a hard distinction between expressions and statements. Users can get these mixed up. When an expression context is trying to use a statement (other than those allowed in StmtExpr's), then it would be nice if the error message was more direct about this.
Background and Motivation
Here's an example:
functionF(): int {
for i := 0 to 10 {
}
}
This currently gives invalid UnaryExpression. Better would be "it looks like your trying to use a for statement in an expression context, but a statement is not an expression".
Proposed Feature
Can this error be substituted in the Coco-generated code? Can it be checked in the parser without causing too many ambiguous-start-symbol errors from the parser generator?
Alternatives
No response
The text was updated successfully, but these errors were encountered:
area: error-reportingClarity of the error reportingkind: enhancementEnhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny
Summary
Dafny makes a hard distinction between expressions and statements. Users can get these mixed up. When an expression context is trying to use a statement (other than those allowed in
StmtExpr
's), then it would be nice if the error message was more direct about this.Background and Motivation
Here's an example:
This currently gives
invalid UnaryExpression
. Better would be "it looks like your trying to use afor
statement in an expression context, but a statement is not an expression".Proposed Feature
Can this error be substituted in the Coco-generated code? Can it be checked in the parser without causing too many ambiguous-start-symbol errors from the parser generator?
Alternatives
No response
The text was updated successfully, but these errors were encountered: