@@ -85371,11 +85371,7 @@ void Interface.Method()
8537185371}
8537285372";
8537385373 var comp = CreateNullableCompilation(text);
85374- comp.VerifyDiagnostics(
85375- // (10,14): warning CS8643: Nullability of reference types in explicit interface specifier doesn't match interface implemented by the type.
85376- // void Interface.Method()
85377- Diagnostic(ErrorCode.WRN_NullabilityMismatchInExplicitlyImplementedInterface, "Interface").WithLocation(10, 14)
85378- );
85374+ comp.VerifyDiagnostics();
8537985375 }
8538085376
8538185377 [Fact]
@@ -85402,11 +85398,7 @@ void Inner<U>.Interface.Method()
8540285398 }
8540385399}
8540485400";
85405- CreateCompilation(text, options: WithNonNullTypesTrue()).VerifyDiagnostics(
85406- // (14,18): warning CS8643: Nullability of reference types in explicit interface specifier doesn't match interface implemented by the type.
85407- // void Inner<U>.Interface.Method()
85408- Diagnostic(ErrorCode.WRN_NullabilityMismatchInExplicitlyImplementedInterface, "Inner<U>.Interface").WithLocation(14, 18)
85409- );
85401+ CreateCompilation(text, options: WithNonNullTypesTrue()).VerifyDiagnostics();
8541085402 }
8541185403
8541285404 [Fact]
@@ -85466,15 +85458,7 @@ void Outer<
8546685458}
8546785459";
8546885460
85469- CreateCompilation(text, options: WithNonNullTypesTrue()).VerifyDiagnostics(
85470- // (14,18): warning CS8643: Nullability of reference types in explicit interface specifier doesn't match interface implemented by the type.
85471- // void Outer<
85472- Diagnostic(ErrorCode.WRN_NullabilityMismatchInExplicitlyImplementedInterface, @"Outer<
85473- #nullable disable
85474- T
85475- #nullable enable
85476- >.Inner<U>.Interface").WithLocation(14, 18)
85477- );
85461+ CreateCompilation(text, options: WithNonNullTypesTrue()).VerifyDiagnostics();
8547885462 }
8547985463
8548085464 [Fact]
@@ -85555,15 +85539,9 @@ void Inner<U>.Interface<U, T>.Method<K>(T a, U[] b, List<U> c, Dictionary<T, K>
8555585539 // (14,39): error CS0535: 'Outer<T>.Inner<U>.Derived4.Derived5' does not implement interface member 'Outer<T>.Inner<U>.Interface<U, T>.Method<Z>(T, U[], List<U>, Dictionary<T, Z>)'
8555685540 // internal class Derived5 : Outer<T>.Inner<U>.Interface<U, T>
8555785541 Diagnostic(ErrorCode.ERR_UnimplementedInterfaceMember, "Outer<T>.Inner<U>.Interface<U, T>").WithArguments("Outer<T>.Inner<U>.Derived4.Derived5", "Outer<T>.Inner<U>.Interface<U, T>.Method<Z>(T, U[], System.Collections.Generic.List<U>, System.Collections.Generic.Dictionary<T, Z>)").WithLocation(14, 39),
85558- // (20,22): warning CS8643: Nullability of reference types in explicit interface specifier doesn't match interface implemented by the type.
85559- // void Inner<U>.Interface<U, T>.Method<K>(T a, U[] b, List<U> c, Dictionary<K, T> D)
85560- Diagnostic(ErrorCode.WRN_NullabilityMismatchInExplicitlyImplementedInterface, "Inner<U>.Interface<U, T>").WithLocation(20, 22),
8556185542 // (20,47): error CS0539: 'Outer<T>.Inner<U>.Derived4.Derived5.Method<K>(T, U[], List<U>, Dictionary<K, T>)' in explicit interface declaration is not found among members of the interface that can be implemented
8556285543 // void Inner<U>.Interface<U, T>.Method<K>(T a, U[] b, List<U> c, Dictionary<K, T> D)
85563- Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "Method").WithArguments("Outer<T>.Inner<U>.Derived4.Derived5.Method<K>(T, U[], System.Collections.Generic.List<U>, System.Collections.Generic.Dictionary<K, T>)").WithLocation(20, 47),
85564- // (30,22): warning CS8643: Nullability of reference types in explicit interface specifier doesn't match interface implemented by the type.
85565- // void Inner<U>.Interface<U, T>.Method<K>(T a, U[] b, List<U> c, Dictionary<T, K> D)
85566- Diagnostic(ErrorCode.WRN_NullabilityMismatchInExplicitlyImplementedInterface, "Inner<U>.Interface<U, T>").WithLocation(30, 22)
85544+ Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "Method").WithArguments("Outer<T>.Inner<U>.Derived4.Derived5.Method<K>(T, U[], System.Collections.Generic.List<U>, System.Collections.Generic.Dictionary<K, T>)").WithLocation(20, 47)
8556785545 );
8556885546 }
8556985547
@@ -85596,11 +85574,7 @@ void Inner<U>.Interface<long, string>.Method<K>(T a, U[] B, List<long> C, Dictio
8559685574}
8559785575";
8559885576
85599- CreateCompilation(source, options: WithNonNullTypesTrue()).VerifyDiagnostics(
85600- // (18,18): warning CS8643: Nullability of reference types in explicit interface specifier doesn't match interface implemented by the type.
85601- // void Inner<U>.Interface<long, string>.Method<K>(T a, U[] B, List<long> C, Dictionary<string, K> d)
85602- Diagnostic(ErrorCode.WRN_NullabilityMismatchInExplicitlyImplementedInterface, "Inner<U>.Interface<long, string>").WithLocation(18, 18)
85603- );
85577+ CreateCompilation(source, options: WithNonNullTypesTrue()).VerifyDiagnostics();
8560485578 }
8560585579
8560685580 [Fact]
@@ -85705,17 +85679,11 @@ void I1<C1<CT1, CT2>>.M()
8570585679 }
8570685680}
8570785681";
85708- var expected = new DiagnosticDescription[] {
85709- // (4,10): warning CS8643: Nullability of reference types in explicit interface specifier doesn't match interface implemented by the type.
85710- // void I1<C1<CT1, CT2>>.M()
85711- Diagnostic(ErrorCode.WRN_NullabilityMismatchInExplicitlyImplementedInterface, "I1<C1<CT1, CT2>>").WithLocation(4, 10)
85712- };
85713-
8571485682 var comp2 = CreateCompilation(source2, options: WithNonNullTypesTrue(), references: new[] { comp1.EmitToImageReference() });
85715- comp2.VerifyDiagnostics(expected );
85683+ comp2.VerifyDiagnostics();
8571685684
8571785685 var comp3 = CreateCompilation(source2, options: WithNonNullTypesTrue(), references: new[] { comp1.ToMetadataReference() });
85718- comp3.VerifyDiagnostics(expected );
85686+ comp3.VerifyDiagnostics();
8571985687 }
8572085688
8572185689 [Fact]
@@ -85967,10 +85935,7 @@ void I1<C1<CT1, CT2>>.M()
8596785935 var expected = new DiagnosticDescription[] {
8596885936 // (2,7): warning CS8645: 'I1<C1<CT1, CT2>>' is already listed in the interface list on type 'C<CT1, CT2>' with different nullability of reference types.
8596985937 // class C<CT1, CT2> : I2<CT1, CT2>,
85970- Diagnostic(ErrorCode.WRN_DuplicateInterfaceWithNullabilityMismatchInBaseList, "C").WithArguments("I1<C1<CT1, CT2>>", "C<CT1, CT2>").WithLocation(2, 7),
85971- // (7,10): warning CS8643: Nullability of reference types in explicit interface specifier doesn't match interface implemented by the type.
85972- // void I1<C1<CT1, CT2>>.M()
85973- Diagnostic(ErrorCode.WRN_NullabilityMismatchInExplicitlyImplementedInterface, "I1<C1<CT1, CT2>>").WithLocation(7, 10)
85938+ Diagnostic(ErrorCode.WRN_DuplicateInterfaceWithNullabilityMismatchInBaseList, "C").WithArguments("I1<C1<CT1, CT2>>", "C<CT1, CT2>").WithLocation(2, 7)
8597485939 };
8597585940
8597685941 var comp2 = CreateCompilation(source2, options: WithNonNullTypesTrue(), references: new[] { comp1.EmitToImageReference() });
@@ -86015,17 +85980,12 @@ void I1<C1<CT1, CT2>>.M()
8601585980 }
8601685981}
8601785982";
86018- var expected = new DiagnosticDescription[] {
86019- // (9,10): warning CS8643: Nullability of reference types in explicit interface specifier doesn't match interface implemented by the type.
86020- // void I1<C1<CT1, CT2>>.M()
86021- Diagnostic(ErrorCode.WRN_NullabilityMismatchInExplicitlyImplementedInterface, "I1<C1<CT1, CT2>>").WithLocation(9, 10)
86022- };
8602385983
8602485984 var comp2 = CreateCompilation(source2, options: WithNonNullTypesTrue(), references: new[] { comp1.EmitToImageReference() });
86025- comp2.VerifyDiagnostics(expected );
85985+ comp2.VerifyDiagnostics();
8602685986
8602785987 var comp3 = CreateCompilation(source2, options: WithNonNullTypesTrue(), references: new[] { comp1.ToMetadataReference() });
86028- comp3.VerifyDiagnostics(expected );
85988+ comp3.VerifyDiagnostics();
8602985989 }
8603085990
8603185991 [Fact]
0 commit comments