Confusing error message when missing parentheses in let-bound pattern match and tree structure
Open
Area-Diagnostics
Feature Improvement
- Dominant language
- F#
- Stars
- 4.3k
- Forks
- 876
- Avg merge
- 4d 22h
- Merged PRs (30d)
- 144
Description
Consider the following:
```fsharp
type T = Node of T *T
module T =
let f t =
let Node(l, r) = t
l, r |> ignore
```
**Expected:**
This either:
* Works just fine
* Gives an error at the `let Node(l, r)` site
**Actual:**
This gives an error on `l` and `r` saying they're undefined:

The fix is to wrap the let-bound pattern match in parentheses:
```fsharp
type T = Node of T *T
module T =
let f t =
let (Node(l, r)) = t
l, r |> ignore
```
Contributor guide
Assessment
This issue has not been assessed yet.