-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sem: fix error propagation for tuple construction
Summary ======= * fix errors in anonymous tuple constructions not being propagated * fix the error for colon expressions in anonymous tuple constructions being "invalid expression" instead of "named expression not allowed here" Details ======= * properly propagate errors from element expressions * don't analyze `nkExprColonExpr` as a normal expression * don't modify input AST * skip tuple type constructor analysis if any of the element expressions is erroneous
- Loading branch information
Showing
2 changed files
with
39 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
discard """ | ||
errormsg: "named expression not allowed here" | ||
line: 7 | ||
""" | ||
|
||
var x = 0 | ||
discard (x, a: x) |