dotnet / dotnet/fsharp

Namespace open is incorrectly reported as redundant

Open
#18,389 2 comments 0 reactions 0 assignees View on GitHub
Area-LangService-CodeFixes Bug Impact-Low
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 22h
Merged PRs (30d)
144

Description

![Image](https://github.com/user-attachments/assets/6a4bc2fe-541a-4d37-a07f-d64f051d11ab)

Compiler doesn't recognize static method in auto-open type ([source](https://github.com/Lanayx/Oxpecker/blob/develop/src/Oxpecker.Solid/SolidRouterBindings.fs))

![Image](https://github.com/user-attachments/assets/2478ed65-0ef9-4973-afd1-19769e1aa40d)

**Repro steps**

1. Create empty project
2. Add Oxpecker.Solid nuget package
3. Add the following code
```fsharp
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.

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.