You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
F# code that tries to use an indexer on an object fails to parse.
Here is the problematic line of code:
analysisKey.Headers.Item(key)<- value
I imagine this probably isn't a very common case 😅
Stack trace
Exception: Unexpected expression: NamedIndexedPropertySet
(LongIdentWithDots
([analysisKey; Headers; Item],
[tmp.fsx (15,19--15,20) IsSynthetic=false;
tmp.fsx (15,27--15,28) IsSynthetic=false]),
Paren
(Ident key,tmp.fsx (15,32--15,33) IsSynthetic=false,
Some tmp.fsx (15,36--15,37) IsSynthetic=false,
tmp.fsx (15,32--15,37) IsSynthetic=false),Ident value,
tmp.fsx (15,8--15,46) IsSynthetic=false) Stack Trace: at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1637.Invoke(String message) in E:\A\_work\130\s\src\fsharp\FSharp.Core\printf.fs:line 1637
at Fantomas.CodePrinter.genExpr(ASTContext astContext, SynExpr synExpr) in /build/.deps/fantomas/src/Fantomas/CodePrinter.fs:line 1168
at Fantomas.CodePrinter.noIndentBreakNln(ASTContext astContext, SynExpr e, Context ctx) in /build/.deps/fantomas/src/Fantomas/CodePrinter.fs:line 494
at [email protected](Context x) in /build/.deps/fantomas/src/Fantomas/CodePrinter.fs:line 886
at [email protected](Context x) in /build/.deps/fantomas/src/Fantomas/CodePrinter.fs:line 2036
at Fantomas.Context.autoNlnCheck[a](FSharpFunc`2 f, FSharpFunc`2 sep, Context ctx) in /build/.deps/fantomas/src/Fantomas/Context.fs:line 390
at Fantomas.Context.autoNlnOrAddSep(FSharpFunc`2 f, FSharpFunc`2 sep, Context ctx) in /build/.deps/fantomas/src/Fantomas/Context.fs:line 413
at [email protected](Context x) in /build/.deps/fantomas/src/Fantomas/CodePrinter.fs:line 1023
at Fantomas.Context.atIndentLevel(Boolean alsoSetIndent, Int32 level, FSharpFunc`2 f, Context ctx) in /build/.deps/fantomas/src/Fantomas/Context.fs:line 164
at [email protected](Context ctx) in /build/.deps/fantomas/src/Fantomas/CodePrinter.fs:line 1017
at [email protected](Context x) in /build/.deps/fantomas/src/Fantomas/CodePrinter.fs:line 2036
at [email protected](Context x) in /build/.deps/fantomas/src/Fantomas/CodePrinter.fs:line 1223
at Fantomas.Context.atIndentLevel(Boolean alsoSetIndent, Int32 level, FSharpFunc`2 f, Context ctx) in /build/.deps/fantomas/src/Fantomas/Context.fs:line 164
at [email protected](Context ctx) in /build/.deps/fantomas/src/Fantomas/CodePrinter.fs:line 928
at [email protected](Context x) in /build/.deps/fantomas/src/Fantomas/CodePrinter.fs:line 2036
at Fantomas.Context.col[T](FSharpFunc`2 f', IEnumerable`1 c, FSharpFunc`2 f, Context ctx) in /build/.deps/fantomas/src/Fantomas/Context.fs:line 261
at [email protected](Context ctx) in /build/.deps/fantomas/src/Fantomas/CodePrinter.fs:line 1068
at Fantomas.Context.atIndentLevel(Boolean alsoSetIndent, Int32 level, FSharpFunc`2 f, Context ctx) in /build/.deps/fantomas/src/Fantomas/Context.fs:line 164
at [email protected](Context ctx) in /build/.deps/fantomas/src/Fantomas/CodePrinter.fs:line 1068
at [email protected](Context x) in /build/.deps/fantomas/src/Fantomas/CodePrinter.fs:line 2036
at [email protected](Tuple`2 tupledArg) in /build/.deps/fantomas/src/Fantomas/Context.fs:line 397
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy`1.CreateValue()
at [email protected](a x) in /build/.deps/fantomas/src/Fantomas/Utils.fs:line 88
at Fantomas.CodePrinter.genExprSepEqPrependType(ASTContext astContext, FSharpFunc`2 prefix, SynPat pat, SynExpr e, Context ctx) in /build/.deps/fantomas/src/Fantomas/CodePrinter.fs:line 470
at [email protected](Context x) in /build/.deps/fantomas/src/Fantomas/CodePrinter.fs:line 2036
at [email protected](Context x) in /build/.deps/fantomas/src/Fantomas/CodePrinter.fs:line 2036
at [email protected](Context x) in /build/.deps/fantomas/src/Fantomas/CodePrinter.fs:line 2036
at Fantomas.Context.col[T](FSharpFunc`2 f', IEnumerable`1 c, FSharpFunc`2 f, Context ctx) in /build/.deps/fantomas/src/Fantomas/Context.fs:line 261
at [email protected](Context ctx) in /build/.deps/fantomas/src/Fantomas/CodePrinter.fs:line 79
at Fantomas.CodeFormatterImpl.formatWith(ParsedInput ast, FSharpList`1 defines, FormatContext formatContext, FormatConfig config) in /build/.deps/fantomas/src/Fantomas/CodeFormatterImpl.fs:line 390
at [email protected](Tuple`2[] _arg1) in /build/.deps/fantomas/src/Fantomas/CodeFormatterImpl.fs:line 407
at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[a,b](AsyncActivation`1 ctxt, FSharpFunc`2 userCode, b result1) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 416
at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 109
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.FSharp.Control.AsyncResult`1.Commit() in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 349
at Microsoft.FSharp.Control.AsyncPrimitives.RunSynchronouslyInCurrentThread[a](CancellationToken cancellationToken, FSharpAsync`1 computation) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 870
at Microsoft.FSharp.Control.AsyncPrimitives.RunSynchronously[T](CancellationToken cancellationToken, FSharpAsync`1 computation, FSharpOption`1 timeout) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 890
at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[T](FSharpAsync`1 computation, FSharpOption`1 timeout, FSharpOption`1 cancellationToken) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 1153
at Server.Result.attempt[a](FSharpFunc`2 f) in /build/src/Server/Server.fs:line 24
Description
F# code that tries to use an indexer on an object fails to parse.
Here is the problematic line of code:
I imagine this probably isn't a very common case 😅
Stack trace
Repro code
Online repro
The text was updated successfully, but these errors were encountered: