dotnet / dotnet/fsharp

A wrong type is reported in a type mismatch error

Open
#18,849 7 comments 1 reaction 0 assignees View on GitHub
Bug good first issue help wanted
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 22h
Merged PRs (30d)
144

Description

Consider this code:
```fsharp
let a, b: int = ()
```

The error is produced on the `unit` expression, but it says that the type is `int`:
Image

```
Error FS0001 : This expression was expected to have type
''a * 'b'
but here has type
'int'
```

This may be happening due to some expressions rewriting during the analysis.

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.