-
-
Notifications
You must be signed in to change notification settings - Fork 194
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
Crash when using --keepNewlineAfter #513
Comments
The issue is not a crash, but an error when formatting. The first time you run And then after this if you run it again, you get the crash because the code is invalid. After a bit of testing, the formatting issue happens when any comment (even an empty one) appears right after this line like so: let signedTransaction = Account.LoadSignedTransactionFromFile fileToReadFrom.FullName
// (has to be right after, no newlines) |
Reduced down to let foo() =
let bar = 6
//
baz
baz2 which gets formatted to let foo() =
let bar = 6
//
baz
baz2 |
It doesn't seem related to (edit: only) single line comments, just an empty line causes it to glitch too let a () =
let q = 1
q
b turns into let a() =
let q = 1
q
b you need a sequence of expressions for it to happen, when arriving there: fantomas/src/Fantomas/CodePrinter.fs Line 1068 in c2338f3
the edit: There is easy fix (#526) for this case without comment but it still fails the same with the comment. |
@knocte you may give a shot at version in master, it looks like it still compiles after running that version. |
Description
I've tried to run fantomas 3.0 in a project inside my solution, and it crashed with:
Repro code
cd src\GWallet.Frontend.Console
fantomas . --recurse --keepNewlineAfter
Current results: crash.
Expected results: shouldn't crash.
The text was updated successfully, but these errors were encountered: