-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix parsing of reference expressions #1622
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1622 +/- ##
=======================================
Coverage 74.73% 74.73%
=======================================
Files 288 288
Lines 55340 55339 -1
=======================================
+ Hits 41357 41358 +1
+ Misses 12489 12487 -2
Partials 1494 1494
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Cadence Benchstat comparisonThis branch with compared with the base branch onflow:master commit f615bea Results
|
Description
Reference expressions are parsed by parsing them as a casting expression.
Currently the reference operator
&
parses any expression, which leads to confusing error messages for valid programs.For example, currently an expression
&v as &T? ?? panic("no v")
is parsed as a reference to a nil-coalescing operation (??
), instead of a nil-coalescing operation of a reference expression.Only parse an expression which has a precedence as high as a casting expression, the expression kind we expect to parse.
This is not a breaking change: Previously the expressions were not accepted, now they will be.
master
branchFiles changed
in the Github PR explorer