dotnet / dotnet/fsharp

Highly confusing error with single whitespace change in a list expression

Open
#5,471 5 comments 0 reactions 1 assignee Claimed by @edgarfgp View on GitHub
Area-Diagnostics Feature Improvement
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 22h
Merged PRs (30d)
144

Description

1. Open `StructureTests.fs`
2. Modify an existing test to offset some whitespace in the list expression

```fsharp
[]
let ``match``() =
"""
match None with // 2
| Some _ -> // 3
() // 4
| None -> // 5
match None with // 6
| Some _ -> () // 7
| None -> // 8
let x = () // 9
() // 10
"""
=> [ (1, 0, 11, 0), (1, 0, 11, 0) // Note this is one space over
(2, 0, 10, 10), (2, 15, 10, 10)
(6, 4, 10, 10), (5, 6, 10, 10)
(6, 4, 10, 10), (6, 19, 10, 10)
(9, 8, 10, 10), (8, 10, 10, 10) ]
```

Result:

Type mismatch error.

![wtf](https://user-images.githubusercontent.com/6309070/43803319-6fc41864-9a4d-11e8-94ce-7407388889f3.gif)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.