dotnet / dotnet/fsharp

Unused opens: extension member in namespace is ignored in analysis

Open
#11,657 0 comments 0 reactions 0 assignees View on GitHub
Area-FCS Bug Impact-Medium
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

In the following code `P1` extension is declared in a namespace, it's not allowed. The symbol is successfully resolved in another namespace (it's good for the tooling), but is not accounted in unused opens analysis.
```fsharp
namespace Ns1

type System.String with
member this.P1 = 1

namespace Ns2

open Ns1

module Module =
"".P1
```

`open Ns1` is considered unused:

Screenshot 2021-06-09 at 16 29 26

Works as expected for extension in a module:

Screenshot 2021-06-09 at 16 29 43

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.