Skip to content

UseMutationWhenValueIsMutable code fix crashes at the EOF #15931

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

Closed
Tracked by #15408
psfinaki opened this issue Sep 5, 2023 · 1 comment · Fixed by #15973
Closed
Tracked by #15408

UseMutationWhenValueIsMutable code fix crashes at the EOF #15931

psfinaki opened this issue Sep 5, 2023 · 1 comment · Fixed by #15973
Assignees
Labels
Area-LangService-CodeFixes Code fixes associated with diagnostics Bug Needs-Triage

Comments

@psfinaki
Copy link
Member

psfinaki commented Sep 5, 2023

Bangggg:

bugger.mp4

Code:

let band = {| Name = "R.E.M." |}

band

Stacktrace:

System.ArgumentOutOfRangeException : Specified argument was out of the range of valid values.
Parameter name: index
   at Microsoft.VisualStudio.Text.Implementation.UnaryStringRebuilder.GetChar(Char[] content,Int32 index)
   at <StartupCode$FSharp-Editor>.$UseMutationWhenValueIsMutable.loop@37-8(SourceText sourceText,Char ch,Int32 pos)
   at async StartupCode$FSharp-Editor(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.VisualStudio.FSharp.Editor.CodeFixExtensions.CodeFixContext-RegisterFsharpFix@108(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.CodeFixes.CodeFixService.GetCodeFixesAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformFunctionAsync[T](<Unknown Parameters>)

Regression, caused by the recent changes.

@psfinaki psfinaki added Bug Area-LangService-CodeFixes Code fixes associated with diagnostics Needs-Triage labels Sep 5, 2023
@github-actions github-actions bot added this to the Backlog milestone Sep 5, 2023
@psfinaki psfinaki mentioned this issue Sep 5, 2023
85 tasks
@psfinaki psfinaki self-assigned this Sep 7, 2023
@psfinaki psfinaki modified the milestones: Backlog, September-2023 Sep 7, 2023
@psfinaki
Copy link
Member Author

Okay so it's not because of anon records, it's because of the end of file there.

@psfinaki psfinaki changed the title UseMutationWhenValueIsMutable code fix crashes for anon records UseMutationWhenValueIsMutable code fix crashes at the EOF Sep 13, 2023
@github-project-automation github-project-automation bot moved this from Not Planned to Done in F# Compiler and Tooling Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-LangService-CodeFixes Code fixes associated with diagnostics Bug Needs-Triage
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant