Skip to content
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

New index syntax fails on raw list #1929

Closed
nojaf opened this issue Oct 27, 2021 · 1 comment
Closed

New index syntax fails on raw list #1929

nojaf opened this issue Oct 27, 2021 · 1 comment

Comments

@nojaf
Copy link
Contributor

nojaf commented Oct 27, 2021

Couldn't use the tool.

let y = [ 0; 2; 4 ][1]

returns

System.Exception: cannot determine if synExpr ArrayOrListComputed
  (false,
   Sequential
     (SuppressNeither, true, Const (Int32 0, tmp.fsx (1,10--1,11)),
      Sequential
        (SuppressNeither, true, Const (Int32 2, tmp.fsx (1,13--1,14)),
         Const (Int32 4, tmp.fsx (1,16--1,17)), tmp.fsx (1,13--1,17)),
      tmp.fsx (1,10--1,17)), tmp.fsx (1,8--1,19)) is uppercase or lowercase
   at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1439.Invoke(String message) in D:\workspace\_work\1\s\src\fsharp\FSharp.Core\printf.fs:line 1439
   at Fantomas.CodePrinter.addSpaceBeforeParensInFunCall(SynExpr functionOrMethod, SynExpr arg, Context ctx)
   at [email protected](Context ctx) in /app/.deps/fantomas/src/Fantomas/CodePrinter.fs:line 3270
   at [email protected](Context ctx)
   at Fantomas.Context.op_PlusGreater(FSharpFunc`2 ctx, FSharpFunc`2 f, Context x) in /app/.deps/fantomas/src/Fantomas/Context.fs:line 487
   at [email protected](Context x) in /app/.deps/fantomas/src/Fantomas/Context.fs:line 452
   at Fantomas.Context.atIndentLevel(Boolean alsoSetIndent, Int32 level, FSharpFunc`2 f, Context ctx) in /app/.deps/fantomas/src/Fantomas/Context.fs:line 446
   at Fantomas.Context.shortExpressionWithFallback(FSharpFunc`2 shortExpression, FSharpFunc`2 fallbackExpression, Int32 maxWidth, FSharpOption`1 startColumn, Context ctx) in /app/.deps/fantomas/src/Fantomas/Context.fs:line 846
   at Fantomas.Context.op_PlusGreater(FSharpFunc`2 ctx, FSharpFunc`2 f, Context x) in /app/.deps/fantomas/src/Fantomas/Context.fs:line 487
   at Fantomas.Context.shortExpressionWithFallback(FSharpFunc`2 shortExpression, FSharpFunc`2 fallbackExpression, Int32 maxWidth, FSharpOption`1 startColumn, Context ctx) in /app/.deps/fantomas/src/Fantomas/Context.fs:line 846
   at Fantomas.Context.op_PlusGreater(FSharpFunc`2 ctx, FSharpFunc`2 f, Context x) in /app/.deps/fantomas/src/Fantomas/Context.fs:line 487
   at Fantomas.Context.op_PlusGreater(FSharpFunc`2 ctx, FSharpFunc`2 f, Context x) in /app/.deps/fantomas/src/Fantomas/Context.fs:line 487
   at Fantomas.Context.col[T](FSharpFunc`2 f', IEnumerable`1 c, FSharpFunc`2 f, Context ctx) in /app/.deps/fantomas/src/Fantomas/Context.fs:line 574
   at [email protected](Context ctx) in /app/.deps/fantomas/src/Fantomas/CodePrinter.fs:line 82
   at Fantomas.Context.op_PlusGreater(FSharpFunc`2 ctx, FSharpFunc`2 f, Context x) in /app/.deps/fantomas/src/Fantomas/Context.fs:line 487
   at Fantomas.CodeFormatterImpl.formatWith(ParsedInput ast, FSharpList`1 defines, FSharpList`1 hashTokens, FormatContext formatContext, FormatConfig config) in /app/.deps/fantomas/src/Fantomas/CodeFormatterImpl.fs:line 388
   at [email protected](Unit unitVar) in /app/.deps/fantomas/src/Fantomas/CodeFormatterImpl.fs:line 408
   at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvoke[T,TResult](AsyncActivation`1 ctxt, TResult result1, FSharpFunc`2 part2) in D:\workspace\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 446
   at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in D:\workspace\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 104
--- End of stack trace from previous location ---
   at [email protected](Unit unitVar0) in /app/src/server/FantomasOnline.Shared/Http.fs:line 95
   at Ply.TplPrimitives.AwaitableContinuation`3.Invoke(Unit r)

https://fsprojects.github.io/fantomas-tools/#/ast?data=N4KABGBEAmCmBmBLAdrAzpAXFSAacUiaAYmolmPAIYA2as%2BEkAxgPZwWQ2wAuYAnmAC8YANpgADAG4wAJhkAWMAF1RARmWQQAXyA

@nojaf
Copy link
Contributor Author

nojaf commented Oct 28, 2021

Might be related to dotnet/fsharp#12309

nojaf added a commit to nojaf/fantomas that referenced this issue Nov 8, 2021
@nojaf nojaf closed this as completed in fc3a16f Jan 14, 2022
jindraivanek pushed a commit to jindraivanek/fantomas that referenced this issue Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant