-
Notifications
You must be signed in to change notification settings - Fork 789
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
Make API usage of FSharpExprPatterns possible with typed union fields #16121
Conversation
So, uhm, anyone interested in this? |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this can go I think? @T-Gro?
Hey @T-Gro |
Workaround for bug in FSharp.Compiler.Services that sometimes results in "FSharp.Compiler.Service cannot yet return this kind of pattern match at ..." exception (see ``Regression found when parsing Console/Program_fs`` test case). Issue in F# github repo: [1]. There is a merged PR that should address this bug: [2]. But at the moment latest FSharp.Compiler.Services on nuget (43.8.101) doesn't include that fix. [1] dotnet/fsharp#8854 [2] dotnet/fsharp#16121
@T-Gro thanks for merging. BTW, just curious, if this was included in a commit from about 2 months ago, and the last release of FCS (43.8.101) was published 9 days ago, why is this fix not included in this last release? |
@dawedawe do you know? ^ |
X.Y.xx1 releases are fix releases, and all additional features are not backported to those, only critical fixes. |
Thanks for your answer Vlad. Do you know then which release number would then include this, and roughly when is it going to hit nuget.org? |
I think 8.0.200 should include it, you can test new versions here if you'd like to: https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet8/NuGet/FSharp.Compiler.Service/overview/43.8.200-preview.24061.1 |
As for release date - I don't know, SDK publishes all of our packages, so it's tied to their release. |
How does that version translate to FCS version numbers in nuget? |
It should be 43.8.200 |
Cool thanks! |
Remove workaround introduced in [1] for bug in FCS [2] that was fixed in FCS 43.8.200. [1] 106be3f [2] dotnet/fsharp#16121
Remove workaround introduced in [1] for bug in FCS [2] that was fixed in FCS 43.8.200. [1] 106be3f [2] dotnet/fsharp#16121
Remove workaround introduced in [1] for bug in FCS [2] that was fixed in FCS 43.8.200. [1] 106be3f [2] dotnet/fsharp#16121
Hey everyone,
FSC offers the
FSharpExprPatterns
Active Patterns API to easily traverse the TAST.Unfortunately, the very common F# construct of a typed union field triggers an exception when traversed:
I hope the testcase in this PR helps to show the issue.
The reason is that DUs are processed by
FSharp.Compiler.AugmentWithHashCompare
to add the membersCompareTo
,GetHashCode
,Equals
fsharp/src/Compiler/Checking/AugmentWithHashCompare.fs
Line 360 in 91ff67b
The
TDSwitch
that is constructed there has no defaultDecisionTree
, it'sNone
.Later this is the reason that the exception is thrown at
fsharp/src/Compiler/Symbols/Exprs.fs
Line 1269 in 91ff67b
The exception throwing code is quite old, so I was wondering if we could improve this today.
But I'm really unsure what a good handling should look like. So this PR has just my best guess (commented out) for a change in Exprs.fs to make traversal possible for code that contains a typed union field.
I'd be very grateful for any pointers how to improve the current situation.