-
Notifications
You must be signed in to change notification settings - Fork 830
Closed
Description
Repro steps
type Strrr () =
inherit System.IO.Stream ()
override _.FlushAsync ct = nullSet <LangVersion>preview</LangVersion>.
Expected behavior
FlushAsync is overridden, no errors reported.
Actual behavior
Intellisense in VS reports No abstract or interface member was found that corresponds to this override, because the entire method signature is not taken into account - the base method with matching signature is virtual.
The code still compiles since the regression was introduced in #14263, which did not make it to .NET 7.
Known workarounds
Use lang version 7.0.
Related information
- VS 17.5.0 Preview 2.0
This test needs to pass:
[<Fact>]
let ``Virtual member was found among virtual and non-virtual overloads with lang preview`` () =
let CSLib =
CSharp """
public class A
{
public void M1(int i) { }
public virtual void M1(string s) { }
}
""" |> withName "CSLib"
let app =
FSharp """
module ClassTests
type Over () =
inherit A ()
override _.M1 (s: string) = ()
"""
app
|> withReferences [CSLib]
|> withLangVersionPreview
|> compile
|> shouldSucceedMetadata
Metadata
Assignees
Type
Projects
Status
Done