-
Notifications
You must be signed in to change notification settings - Fork 138
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
Statically prevent referenced-typed subexpressions in default arguments to destroy events #2996
Conversation
…ts to destroy events
Cadence Benchstat comparisonThis branch with compared with the base branch onflow:master commit 32ddd35 Collapsed results for better readability
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #2996 +/- ##
=======================================
Coverage 79.98% 79.99%
=======================================
Files 356 356
Lines 82884 82915 +31
=======================================
+ Hits 66298 66326 +28
- Misses 14230 14232 +2
- Partials 2356 2357 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
It should not be possible to have a reference-typed sub expression (with the exception of
self
andbase
) appear in a destroy event default argument, as these references may be invalidated. If they are invalidated, accessing them will result in a runtime error, thus potentially creating an indestructible resource.This PR adds a check enforcing that the (optional-unwrapped)
ResultingType
of anyMemberExpression
orIndexExpression
is not aReferenceType
.Thanks to @oebeling for the report.
master
branchFiles changed
in the Github PR explorer