<Fact>
Public Sub MethodImplementation_27()
Dim csSource =
"
public interface I1
{
protected static string M1()
{
return ""I1.M1"";
}
}
"
Dim csCompiation = GetCSharpCompiation(csSource).EmitToImageReference()
Dim source1 =
<compilation>
<file name="c.vb"><![CDATA[
Public Class C
Implements I1
Shared Sub Main()
System.Console.WriteLine(I1.M1())
End Sub
End Class
]]></file>
</compilation>
Dim comp1 = CreateCompilation(source1, options:=TestOptions.DebugExe, targetFramework:=TargetFramework.DesktopLatestExtended, references:={csCompiation})
comp1.AssertTheseDiagnostics(
<error>
BC30390: 'I1.Function M1() As String' is not accessible in this context because it is 'Protected'.
System.Console.WriteLine(I1.M1())
~~~~~
</error>)
End Sub
Expect to see an error similar to:
error CS8707: Target runtime doesn't support 'protected', 'protected internal', or 'private protected' accessibility for a member of an interface.
Observed: Only accessibility error is reported which will go away once #35827 is fixed.
Expect to see an error similar to:
Observed: Only accessibility error is reported which will go away once #35827 is fixed.