Wrong generic constraint placement in ML-style generic definitions with multiple type parameters
Issue created from fantomas-online
Code
module Utils
/// ML-style alias of Map
type ('key, 'value) map when 'key : comparison = Map<'key, 'value>
Result
module Utils
/// ML-style alias of Map
type ('key, 'value when 'key: comparison) map = Map<'key, 'value>
Problem description
Using ML-style generic type definitions is an uncommon but supported syntax choice.
To use multiple type parameters, they're wrapped in parentheses like a tuple. Fantomas puts any generic type constraints inside those parentheses, instead of outside as correct.
Extra information
- [x] The formatted result breaks by code.
- [ ] The formatted result gives compiler warnings.
- [x] I or my company would be willing to help fix this.
Options
Fantomas Master at 08/11/2021 17:06:14 - 383b729f46ebc01dde282967c68337d5ad55fa17
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?
Thanks for the report, are you interested in submitting a PR?
Yes, I hope to get the chance next week.
This problem seems fixed now. A regression test could close this issue.