Improve compilation error when parametrizing non-partial active patterns
Open
Area-Diagnostics
Feature Request
- Dominant language
- F#
- Stars
- 4.3k
- Forks
- 876
- Avg merge
- 4d 22h
- Merged PRs (30d)
- 144
Description
As I understand it, non-partial active patterns may not have extra parameters:
```f#
let inline (|Lt|Gt|Eq|) compareWith x =
if x < compareWith then Lt
elif x > compareWith then Gt
else Eq
match 2 with
| Lt 3 -> ()
//^^^^
// Type mismatch. Expecting a 'int -> Choice<'a,'b,'c>' but given a
// 'int -> int -> Choice' The type 'Choice<'a,'b,'c>'
// does not match the type 'int -> Choice'
```
The error is very confusing. It would be better to have an error on the active pattern definition itself.
Contributor guide
Assessment
This issue has not been assessed yet.