ionide / FsAutoComplete

F# language server using Language Server Protocol
Other
385 stars 151 forks source link

Invalid `This qualifier is redundant` when a variable is shadowed by a property with the same name and compatible signature #1259

Open MangelMaxime opened 3 months ago

MangelMaxime commented 3 months ago

Version

Ionide 7.18.2

Dotnet Info

.NET SDK: Version: 8.0.100 Commit: 57efcf1350 Workload version: 8.0.100-manifests.6c33ef20

Runtime Environment: OS Name: Mac OS X OS Version: 14.4 OS Platform: Darwin RID: osx-arm64 Base Path: /usr/local/share/dotnet/sdk/8.0.100/

.NET workloads installed: Workload version: 8.0.100-manifests.6c33ef20 There are no installed workloads to display.

Host: Version: 8.0.0 Architecture: arm64 Commit: 5535e31a71

.NET SDKs installed: 6.0.416 [/usr/local/share/dotnet/sdk] 7.0.403 [/usr/local/share/dotnet/sdk] 8.0.100-rc.2.23502.2 [/usr/local/share/dotnet/sdk] 8.0.100 [/usr/local/share/dotnet/sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 6.0.24 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.13 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.0-rc.2.23480.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.24 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.13 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.0-rc.2.23479.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found: None

Environment variables: Not set

global.json file: /Users/mmangel/Workspaces/Github/glutinum-org/Glutinum.Converter/global.json

Learn more: https://aka.ms/dotnet/info

Download .NET: https://aka.ms/dotnet/download

Steps to reproduce

Load this code and see that envelop.user.Name has a redundant quick fix associated to it.

type User (name) =
    member val Name = name

type Envelop () =
    member val user = User("toto")

let test =
    let user = User("user")
    let envelop = Envelop()

    if envelop.user.Name = "maxime" then
        printfn "It works"
    else
        printfn "It doesn't work"

Details

Should not be reported as redundant

Logs

No response

Checklist