fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

Unused opens: extension member in namespace is ignored in analysis

Open auduchinok opened this issue 4 years ago • 0 comments

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.

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

auduchinok avatar Jun 09 '21 13:06 auduchinok