Unused opens false positive: extension method is preferred to instance method
- Dominant language
- F#
- Stars
- 4.3k
- Forks
- 876
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 131
Description
During checking `open ...` statements, extension method is chosen instead of instance one, which differs from actual name resolution during the type check phase.
A guess before looking into: It may be another getting declaring vs apparent entity bug.
```csharp
using System;
namespace Ns1
{
public class Extended
{
public void M(Action a)
{
}
}
}
namespace Ns2
{
public static class Extension
{
public static void M(this Ns1.Extended b, Action a)
{
}
}
}
```
```fsharp
namespace ClassLibrary13
open Ns1
open Ns2
type T() =
member x.Foo(s: string) = ()
member x.Bar() =
Extended().M(x.Foo)
Extended().M(fun s -> x.Foo(s))
```
Contributor guide
Assessment
This issue has not been assessed yet.