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

Invalid code produced when formatting type alias for struct tuple #605

Closed
maxdeviant opened this issue Dec 17, 2019 · 1 comment · Fixed by #609
Closed

Invalid code produced when formatting type alias for struct tuple #605

maxdeviant opened this issue Dec 17, 2019 · 1 comment · Fixed by #609

Comments

@maxdeviant
Copy link

Issue created from fantomas-ui

When formatting a type alias for a struct tuple the resulting code is not valid F#.

Code

This compiles correctly:

type TupleStruct = (struct (string * string))

Error

This no longer compiles without the wrapping parentheses:

type TupleStruct = struct (string * string)

Note that this seems like it might be a shortcoming in the F# compiler: dotnet/fsharp#7014.

Options

Fantomas 3.1.0

Name Value
IndentOnTryWith false
IndentSpaceNum 4
KeepNewlineAfter false
MaxIfThenElseShortWidth 40
PageWidth 120
ReorderOpenDeclaration false
SemicolonAtEndOfLine false
SpaceAfterComma true
SpaceAfterSemicolon true
SpaceAroundDelimiter true
SpaceBeforeArgument true
SpaceBeforeColon false
StrictMode false
@nojaf
Copy link
Contributor

nojaf commented Dec 18, 2019

I think it would be possible to always wrap struct tuple in parentheses.

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

Successfully merging a pull request may close this issue.

2 participants