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

Operator application to some literals doesn't preserve spacing #1979

Closed
3 tasks done
baronfel opened this issue Nov 24, 2021 · 0 comments · Fixed by #1980
Closed
3 tasks done

Operator application to some literals doesn't preserve spacing #1979

baronfel opened this issue Nov 24, 2021 · 0 comments · Fixed by #1980

Comments

@baronfel
Copy link
Contributor

Issue created from fantomas-online

Sharplab link to formatted results

Code

let (!!) (x: 'a): 'b = unbox x

let signed: string = !! -2

let signedLong: string = !! -2L

let signedFloat: string = !! -2.

let unsigned: string = !! 2

let string: string = !! "hi"

let boolean: string = !! true

Result

let (!!) (x: 'a) : 'b = unbox x

let signed: string = !!-2 // compilation error

let signedLong: string = !!-2L // compilation error

let signedFloat: string = !!-2. // compilation error

let unsigned: string = !!2

let string: string = !! "hi"

let boolean: string = !!true

Problem description

For at least signed int32/int64/float literals this formatting is not valid and results in compilation errors, because !!- is parsed as an operator.

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 4.6 branch at 11/19/2021 20:14:05 - 720227d

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.

2 participants