-
Notifications
You must be signed in to change notification settings - Fork 744
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
Provide code actions to fix invalid transferring of an isolated value out from a lock statement #42734
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #42734 +/- ##
=========================================
Coverage 77.35% 77.35%
- Complexity 58262 58289 +27
=========================================
Files 3450 3452 +2
Lines 218969 219031 +62
Branches 28745 28755 +10
=========================================
+ Hits 169379 169432 +53
- Misses 40262 40268 +6
- Partials 9328 9331 +3 ☔ View full report in Codecov by Sentry. |
320c306
to
69485b3
Compare
This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the |
This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the |
@nipunayf, shall we add a test case like this? isolated stream<string[]> streamName = new;
isolated function isolatedFn3() returns record {| string[] value; |}? {
lock {
return streamName.next();
}
} Here it gives only 2 CAs. |
This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the |
Purpose
$title.
Fixes #42333
Approach
Introduced two code actions, namely
clone value
andadd readonly type
, to fix the respective scenarios.Samples
Clone the value
Screen.Recording.2024-05-10.at.5.21.20.PM.mov
Clone as a readonly value
Screen.Recording.2024-05-10.at.5.21.29.PM.mov
Add readonly to type
Screen.Recording.2024-05-20.at.11.04.55.PM.mov
Remarks
Add readonly
code action as their original location points to the definition.Check List