[Improvement]: Provide code actions to fix invalid access of mutable storage #42331
Labels
Area/CodeAction
Language Server Code Actions
Team/LanguageServer
Language Server Implementation related issues. #Compiler
Type/Improvement
Milestone
Description
The fix for the error message
invalid access of mutable storage in an 'isolated' function (BCE3943)
is decisive based on the user's preference. If the user only wants to read the values, they can make the variable immutable. On the contrary, if they intend to manipulate the data structure in a concurrent-safe manner, they can decide to make the variable isolated. Since both fixes are rather straightforward, the LS can provide CAs as quick fixes.Describe your problem(s)
No response
Describe your solution(s)
Consider the following source code with the respective diagnostic.
FIX1: Allow the user to make the variable immutable by making it final and/or readonly.
FIX2: Allow the user to make the variable isolated when the user knows that they have to manipulate the data structure in a concurrent-safe manner.
Related area
-> Compilation
Related issue(s) (optional)
#28681
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response
The text was updated successfully, but these errors were encountered: