dotnet / fsharp

The F# compiler, F# core library, F# language service, and F# tooling integration for Visual Studio
https://dotnet.microsoft.com/languages/fsharp
MIT License
3.88k stars 783 forks source link

AND operator stopped working in some active patterns #17134

Closed psfinaki closed 4 months ago

psfinaki commented 4 months ago

Active pattern after the & used to be allowed:

let (_ : exn & Failure _ | _) = exn ()

Same applies for a match on an exception type declared with the exception keyword, which was also allowed before:

exception MyExn

let (_ : exn & MyExn | _) = exn ()

This causes parser errors now, like

Constraint intersection syntax may only be used with flexible types, e.g. '#IDisposable & #ISomeInterface'.

_Originally posted by @brianrourkeboll in https://github.com/dotnet/fsharp/pull/17113#discussion_r1596020344_