This code throws:
type MyType = { Value: int }
let test = { Value = 42 }x
The stack trace:
System.ArgumentOutOfRangeException : Specified argument was out of the range of valid values.
Parameter name: index
at Microsoft.VisualStudio.Text.Implementation.StringRebuilderForString.get_Item(Int32 index)
at async StartupCode$FSharp-Editor(<Unknown Parameters>)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.VisualStudio.FSharp.Editor.CodeFixExtensions.CodeFixContext-RegisterFsharpFix@93(<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>)
This happens because the code above happens to produce FS0003 (This value is not a function) whereas the code fix searches for the - sign in the code and fails to find one here.
This code throws:
The stack trace:
This happens because the code above happens to produce FS0003 (This value is not a function) whereas the code fix searches for the
-sign in the code and fails to find one here.