Skip to content

Namespace open is incorrectly reported as redundant #18389

@Lanayx

Description

@Lanayx

Image

Compiler doesn't recognize static method in auto-open type (source)

Image

Repro steps

  1. Create empty project
  2. Add Oxpecker.Solid nuget package
  3. Add the following code
open Oxpecker.Solid.Router // editor incorrectly suggest to remove this open

let test() =
    let nav = useNavigate()
    nav.Invoke("/")

Expected behavior

Open removal is not suggested

Actual behavior

Open removal is suggested

Known workarounds

Ignore the suggestion

Related information

.NET SDK:
 Version:           9.0.101
 Commit:            eedb237549
 Workload version:  9.0.100-manifests.4a280210
 MSBuild version:   17.12.12+1cce77968

This issue is reproduced both in Rider and Visual Studio.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-LangService-CodeFixesCode fixes associated with diagnosticsBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.

    Type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions