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

Add support for LibraryOnlyStaticOptimization #1769

Closed
1 of 3 tasks
nojaf opened this issue Jun 6, 2021 · 0 comments · Fixed by #1788
Closed
1 of 3 tasks

Add support for LibraryOnlyStaticOptimization #1769

nojaf opened this issue Jun 6, 2021 · 0 comments · Fixed by #1788

Comments

@nojaf
Copy link
Contributor

nojaf commented Jun 6, 2021

Issue created from fantomas-online

Code

            let FromZero () : 'T = 
                (get32 0 :?> 'T) when 'T : BigInteger = BigInteger.Zero 

Error

Fantomas.FormatConfig+FormatException: Unsupported construct(s) between line 3 column 17 and line 3 column 33
   at Fantomas.CodePrinter.genExpr(ASTContext astContext, SynExpr synExpr, Context ctx) in /workspace/.deps/fantomas/src/Fantomas/CodePrinter.fs:line 2430
   at Fantomas.Context.shortExpressionWithFallback(FSharpFunc`2 shortExpression, FSharpFunc`2 fallbackExpression, Int32 maxWidth, FSharpOption`1 startColumn, Context ctx) in /workspace/.deps/fantomas/src/Fantomas/Context.fs:line 842
   at Fantomas.Context.op_PlusGreater(FSharpFunc`2 ctx, FSharpFunc`2 f, Context x) in /workspace/.deps/fantomas/src/Fantomas/Context.fs:line 489
   at Fantomas.Context.op_PlusGreater(FSharpFunc`2 ctx, FSharpFunc`2 f, Context x) in /workspace/.deps/fantomas/src/Fantomas/Context.fs:line 489
   at Fantomas.Context.col[T](FSharpFunc`2 f', IEnumerable`1 c, FSharpFunc`2 f, Context ctx) in /workspace/.deps/fantomas/src/Fantomas/Context.fs:line 576
   at Fantomas.CodePrinter.genImpFile@81-6.Invoke(Context ctx) in /workspace/.deps/fantomas/src/Fantomas/CodePrinter.fs:line 81
   at Fantomas.Context.op_PlusGreater(FSharpFunc`2 ctx, FSharpFunc`2 f, Context x) in /workspace/.deps/fantomas/src/Fantomas/Context.fs:line 489
   at Fantomas.CodeFormatterImpl.formatWith(ParsedInput ast, FSharpList`1 defines, FSharpList`1 hashTokens, FormatContext formatContext, FormatConfig config) in /workspace/.deps/fantomas/src/Fantomas/CodeFormatterImpl.fs:line 391
   at Fantomas.CodeFormatterImpl.format@406-1.Invoke(Tuple`3[] _arg1) in /workspace/.deps/fantomas/src/Fantomas/CodeFormatterImpl.fs:line 408
   at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[a,b](AsyncActivation`1 ctxt, FSharpFunc`2 userCode, b result1) in D:\workspace\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 404
   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 FantomasOnline.Server.Shared.Http.formatResponse@95-6.Invoke(Unit unitVar0) in /workspace/src/server/FantomasOnline.Shared/Http.fs:line 95
   at Ply.TplPrimitives.AwaitableContinuation`3.Invoke(Unit r)

Problem description

Investigate whether it is possible to add support for SynExpr.LibraryOnlyStaticOptimization.

Extra information

  • The formatted result breaks by code.
  • The formatted result gives compiler warnings.
  • I or my company would be willing to help fix this.

Options

Fantomas Master at 06/05/2021 12:02:39 - c557f79

Default Fantomas configuration

Did you know that you can ignore files when formatting from fantomas-tool or the FAKE targets by using a .fantomasignore file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant