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
Static optimization when ^T struct loses struct #3514
A static optimization constraint when ^T struct loses its struct, and the result does not parse: when ^T = 1.
when ^T : int = 1, the other kind of constraint (StaticOptimizationConstraint.WhenTyparTyconEqualsTycon), keeps its type. Static optimizations are meant for FSharp.Core, so this is unlikely to reach anyone else, but the Oak has a node for this case (StaticOptimizationConstraint.WhenTyparIsStruct) and it prints only the type parameter.
Fails on 8.0.6, 7.0.5 and main.
Found while writing a snapshot case for that union case in #3512.
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.
I would like a release if this problem is solved.
Options
Fantomas main branch at 2026-10-02T18:44:31Z - 8bf81a1
Default Fantomas configuration
Did you know that you can ignore files when formatting by using a .fantomasignore file? PS: It's unlikely that someone else will solve your specific issue, as it's something that you have a personal stake in.
Activity
Keep struct in a when ^T struct static optimization