Closed AlekseyTs closed 5 years ago
Here is another scenario:
<Fact>
<WorkItem(35948, "https://github.com/dotnet/roslyn/issues/35948")>
Public Sub EventImplementation_36()
Dim csSource =
"
public interface I1
{
private protected static event System.Action P1;
}
"
Dim csCompiation = GetCSharpCompiation(csSource).EmitToImageReference()
Dim source1 =
<compilation>
<file name="c.vb"><![CDATA[
Public Class C
Implements I1
Shared Sub Main()
AddHandler I1.P1, Nothing
RemoveHandler I1.P1, Nothing
End Sub
End Class
]]></file>
</compilation>
Dim comp1 = CreateCompilation(source1, targetFramework:=TargetFramework.NetStandardLatest, references:={csCompiation})
comp1.AssertTheseDiagnostics(
<error>
BC30389: 'I1.P1' is not accessible in this context because it is 'Private Protected'.
AddHandler I1.P1, Nothing
~~~~~
BC30389: 'I1.P1' is not accessible in this context because it is 'Private Protected'.
RemoveHandler I1.P1, Nothing
~~~~~
</error>)
Dim comp2 = CreateCompilation(source1, targetFramework:=TargetFramework.NetStandardLatest, references:={csCompiation}, options:=TestOptions.DebugDll.WithMetadataImportOptions(MetadataImportOptions.All))
comp2.AssertTheseDiagnostics(
<error>
BC30389: 'I1.P1' is not accessible in this context because it is 'Private'.
AddHandler I1.P1, Nothing
~~~~~
BC30389: 'I1.P1' is not accessible in this context because it is 'Private'.
RemoveHandler I1.P1, Nothing
~~~~~
</error>)
End Sub
Observed:
BC30389: 'I1.P1' is not accessible in this context because it is 'Private'.
Expected:
BC30389: 'I1.P1' is not accessible in this context because it is 'Private Protected'.
Observed:
Expected: