You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Fact]publicvoidPartialMembers(){varsource1=""" C c = null; c.M(); _ = c.P; """;varsource2=""" partial class C(int p) { public partial void M() { } public partial void M(); public partial object P { get; } public partial object P { get => null; } } """;varcomp=CreateCompilation([source1,source2]);vartree=comp.SyntaxTrees[0];varmodel=comp.GetSemanticModel(tree);model.GetDiagnostics().Verify(// (2,3): error CS0121: The call is ambiguous between the following methods or properties: 'C.M()' and 'C.M()'// c.M();Diagnostic(ErrorCode.ERR_AmbigCall,"M").WithArguments("C.M()","C.M()").WithLocation(2,3),// (3,7): error CS0229: Ambiguity between 'C.P' and 'C.P'// _ = c.P;Diagnostic(ErrorCode.ERR_AmbigMember,"P").WithArguments("C.P","C.P").WithLocation(3,7));}
Expected Behavior:
No errors from the call to model.GetDiagnostics().
Actual Behavior:
Ambiguity errors included above.
The text was updated successfully, but these errors were encountered:
Version Used: 2ff1a47
Steps to Reproduce:
Run the following unit test.
Expected Behavior:
No errors from the call to
model.GetDiagnostics()
.Actual Behavior:
Ambiguity errors included above.
The text was updated successfully, but these errors were encountered: