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
{{ message }}
Repository navigation
Delegates are broken up around -> which leads to illegal code #2468
In the example here I used some nonsense delegate just to illustrate the issue. It happens whenever the delegate definition is too wide. The result is non-compilable.
As a workaround I just place these definitions (I have a bunch of them) in a separate file and ignore it. I know delegates aren't really used that much in F# anyway.
Btw, tbh, I don't really know what a "best practice" format is for delegates, but I think the easiest fix would be to simply not format them at all. Alternatively, something like this works:
type some_delegate = delegate of
Func<int, int> * Guid * string * Func<Func<int, int>, int> ->
Func<Func<int, int>, string, string>
Another way would be this:
type some_delegate =
delegate of
Func<int, int> * Guid * string * Func<Func<int, int>, int> ->
Func<Func<int, int>, string, string>
Extra information
The formatted result breaks my code.
The formatted result gives compiler warnings errors.
I or my company would be willing to help fix this. (I'm a bit busy, but I'll try!)
Options
Fantomas master branch at 2022-08-31T07:53:05Z - 0981dfe
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?
Activity
nojaf commentedon Aug 31, 2022
Hello, thank you for the report.
This might be a duplicate of #1514.
You would want to go with
In order to avoid a vanity alignment.
I believe the delegate body would play out correctly according to the other rules of function types here.
The first part of this pointer, might already be enough in this case.
Are you interested in submitting a PR?
abelbraaksma commentedon Aug 31, 2022
Sure. I was planning to do some OS work over the weekend, so I might try this.
Bump the dotnet-sidecars group with 6 updates (#257)
Bump the packages group with 5 updates (#106)
Bump the packages group with 6 updates (#84)