dotnet / dotnet/fsharp

Warning missing for members hiding members in special inheritance cases

Open
#5,803 4 comments 0 reactions 1 assignee Claimed by @edgarfgp View on GitHub
Area-Diagnostics Feature Improvement
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 22h
Merged PRs (30d)
144

Description

The compiler isn't warning about that the member `Foo` of `DerivedDerived` is hiding the member `Foo` of `Derived`. It's only warning that `Foo` of `Derived` is hiding `Foo` of `Base`.
```fsharp
type Base() =
abstract member Foo : unit -> unit
default this.Foo() = printfn "Base"

type Derived() =
inherit Base()
member this.Foo() = printfn "Derived"

type DerivedDerived() =
inherit Derived()
member this.Foo() = printfn "DerivedDerived"
```

#### Expected behavior

Compiler warns that `DerivedDerived` is hiding a member of `Derived`.

#### Actual behavior

No warning.

#### Known workarounds

None

#### Related Information

F# 4.5

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.