You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
moduleTestletcreateTuple(a:string)(b:string)= a, b
letvalue=match"string"with|"value"->"1","2"|_->"111111111111111111111111111111111111111111111111111111111111111111111","22222222222222222222222222222222222"||> createTuple
Result
moduleTestletcreateTuple(a:string)(b:string)= a, b
letvalue=match"string"with|"value"->"1","2"|_->"111111111111111111111111111111111111111111111111111111111111111111111","22222222222222222222222222222222222"||> createTuple
Problem description
Running version 6.0.1 of Fantomas locally results in a slighly different formating compared to the online version:
moduleTestletcreateTuple(a:string)(b:string)= a, b
letvalue=match"string"with|"value"->"1","2"|_->"111111111111111111111111111111111111111111111111111111111111111111111","22222222222222222222222222222222222"||> createTuple
Both the code generated by Fantomas online and localy results in the same compilation error. Running dotnet build with the .NET SDK 7.0.203 will give the following error:
C:\repos\test\test.fs(10,9): error FS0001: This expression was expected to have type↔ ''a * 'b' ↔but here has type↔ 'string' [C:\repos\test\test.fsproj]
C:\repos\test\test.fs(10,51): error FS0001: The type 'string' does not match the type 'string * string' [C:\repos\test\test.fsproj]
The problem is that the call to ||> createTuple will be run on the entire match-expression when there isn't a newline. When there is a newline, it will only be run against the line above.
Adding parenthesis around the entire match expression before calling createTuple is a workaround.
Extra information
The formatted result breaks my code.
The formatted result gives compiler warnings.
I or my company would be willing to help fix this.
Options
Fantomas main branch at 04/26/2023
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?
The text was updated successfully, but these errors were encountered:
We have seen this problem pop up as well when the indent_size is 2.
As a workaround there we have wrapped the match expression in parentheses (as a last resort).
Issue created from fantomas-online
Code
Result
Problem description
Running version 6.0.1 of Fantomas locally results in a slighly different formating compared to the online version:
Both the code generated by Fantomas online and localy results in the same compilation error. Running
dotnet build
with the .NET SDK 7.0.203 will give the following error:The problem is that the call to
||> createTuple
will be run on the entirematch
-expression when there isn't a newline. When there is a newline, it will only be run against the line above.Adding parenthesis around the entire match expression before calling
createTuple
is a workaround.Extra information
Options
Fantomas main branch at 04/26/2023
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?
The text was updated successfully, but these errors were encountered: