Skip to content

AND operator stopped working in some active patterns #17134

@psfinaki

Description

@psfinaki

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 #17113 (comment)

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions