dotnet / dotnet/fsharp

Don't give overload resolution error if there's an error inside the method call

Open
#5,575 2 comments 0 reactions 0 assignees View on GitHub
Area-Diagnostics Feature Request
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 22h
Merged PRs (30d)
144

Description

I would like to propose a better error message experience when there are errors inside an overloaded method call that cause overload resolution to fail.

#### Repro steps

```f#
type Foo() =

static member Bar(x: string) = x
static member Bar(x: int) = x

let foo = Foo.Bar(unknownParam)
```

#### Expected behavior

A squiggle is placed only over the unknown parameter.

#### Actual behavior

A squiggle is placed over the entire method call complaining about overload resolution:

![image](https://user-images.githubusercontent.com/7766733/44904866-ab4f8f00-ad10-11e8-8b8c-75f0fb194566.png)

It is only if you mouseover the unknown parameter that you actually get the relevant error (below a listing of overload candidates):

![image](https://user-images.githubusercontent.com/7766733/44904914-ce7a3e80-ad10-11e8-9e1a-e1a96b64e518.png)

In more complicated method calls with many parameters and/or many overloads (I frequently experience this using [Polly](https://github.com/App-vNext/Polly)), this makes it next to impossible to see what's wrong unless you happen to mouseover the exact right part of the call. Even then it can be impossible to see, because (for Polly's numerous and verbose overloads) the popup can fill the entire screen with candidates (even on a 2560x1440 screen).

#### Known workarounds

None.

#### Related information

* VS 15.8.2
* F# tools 10.2 for F# 4.5 - 15.8.0.0

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.