Misleading error message when lambda literals violate equality constraints
Open
Area-Diagnostics
Feature Improvement
- Dominant language
- F#
- Stars
- 4.3k
- Forks
- 876
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 131
Description
**Repro steps**
```fsharp
type Foo<'T when 'T : equality> = Foo of 'T
// error FS0002: This function takes too many arguments, or is used in a context where a function is not expected
Foo (fun x -> x + 1)
// error FS0001: The type '(int -> int)' does not support the 'equality' constraint because it is a function type
let f x = x + 1 in Foo f
```
**Expected behavior**
The first expression should produce the same error message as the second expression.
Contributor guide
Assessment
This issue has not been assessed yet.