166 references to WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
Microsoft.CodeAnalysis.CSharp (5)
Errors\ErrorFacts.cs (3)
41
nullableWarnings.Add(GetId(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
));
461
case ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
:
1976
or ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
Generated\ErrorFacts.Generated.cs (1)
221
case ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
:
Symbols\ConstraintsHelper.cs (1)
1158
nullabilityDiagnosticsBuilderOpt.Add(new TypeParameterDiagnosticInfo(typeParameter, new UseSiteInfo<AssemblySymbol>(new CSDiagnosticInfo(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, containingSymbol.ConstructedFrom(), typeParameter, typeArgument))));
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (7)
Attributes\AttributeTests_Nullable.cs (2)
1538
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "object?").WithArguments("C<T, U>", "T", "object?").WithLocation(5, 15),
1541
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "object?").WithArguments("C<T, U>", "T", "object?").WithLocation(6, 15)
Semantics\ExtensionOperatorsTests.cs (2)
9700
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "--x").WithArguments("Extensions1.extension<T>(T)", "T", "C2?").WithLocation(19, 10),
26553
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "x -= 1").WithArguments("Extensions1.extension<T>(T)", "T", "C2?").WithLocation(19, 10),
Semantics\ExtensionTests2.cs (1)
2571
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "First").WithArguments("ListExtensions.extension<T>(System.Collections.Generic.List<T>)", "T", "string?").WithLocation(15, 23),
Semantics\RecordTests.cs (2)
25720
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "string?").WithArguments("R<T>", "T", "string?").WithLocation(10, 23),
25723
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "string?").WithArguments("R2<T>", "T", "string?").WithLocation(11, 25)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (153)
Semantics\DelegateTypeTests.cs (1)
3050
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "new C().M<object?>").WithArguments("C.M<T>()", "T", "object?").WithLocation(2, 9)
Semantics\NullableReferenceTypesTests.cs (150)
8438
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "string?").WithArguments("C<T>", "T", "string?").WithLocation(18, 25),
8441
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "x").WithArguments("C<T>", "T", "string?").WithLocation(34, 33),
8444
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "string?").WithArguments("C<T>", "T", "string?").WithLocation(35, 35),
8450
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "string?").WithArguments("C<T>", "T", "string?").WithLocation(37, 29),
8453
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "D2").WithArguments("C<T>", "T", "string?").WithLocation(39, 11),
8456
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "+").WithArguments("C<T>", "T", "T?").WithLocation(40, 34),
8459
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "y").WithArguments("C<T>", "T", "T?").WithLocation(40, 50),
8462
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "x").WithArguments("C<T>", "T", "T?").WithLocation(43, 18),
8465
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "x").WithArguments("C<T>", "T", "string?").WithLocation(45, 36)
28801
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, out T)", "T", "T?").WithLocation(34, 13),
28810
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, out T?)", "T", "T?").WithLocation(38, 13),
28825
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, out T)", "T", "T?").WithLocation(48, 13),
28834
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, out T?)", "T", "T?").WithLocation(52, 13),
31719
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, out T)", "T", "T?").WithLocation(34, 13),
31725
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, out T?)", "T", "T?").WithLocation(38, 13),
31734
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, out T)", "T", "T?").WithLocation(48, 13),
31740
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, out T?)", "T", "T?").WithLocation(52, 13),
35223
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "CopyOrDefault").WithArguments("C.CopyOrDefault<T>(T, out T?)", "T", "string?").WithLocation(6, 9),
35299
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "CopyOrDefault").WithArguments("C.CopyOrDefault<T>(T, out T?[])", "T", "string?").WithLocation(6, 9),
36392
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Copy").WithArguments("C.Copy<T>(T, out T?)", "T", "string?").WithLocation(7, 9)
36604
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Copy").WithArguments("C.Copy<T>(T)", "T", "string?").WithLocation(6, 17),
40106
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(20, 9),
40109
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(26, 9));
40359
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F1").WithArguments("A.F1<T>(T)", "T", "object?").WithLocation(7, 9),
40362
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T)", "T", "object?").WithLocation(9, 9));
41195
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F1").WithArguments("A.F1<T>(T, T)", "T", "object?").WithLocation(10, 9),
41198
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F1").WithArguments("A.F1<T>(T, T)", "T", "object?").WithLocation(11, 9),
41201
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F1").WithArguments("A.F1<T>(T, T)", "T", "object?").WithLocation(13, 9),
41204
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T, T)", "T", "object?").WithLocation(15, 9),
41207
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T, T)", "T", "object?").WithLocation(16, 9),
41210
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T, T)", "T", "object?").WithLocation(18, 9),
41213
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T, T)", "T", "object?").WithLocation(20, 9),
41216
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T, T)", "T", "object?").WithLocation(21, 9)
43929
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(21, 16),
43941
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(27, 16),
44118
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(21, 16),
44130
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(27, 16),
45898
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(21, 9),
45904
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T)", "T", "T?").WithLocation(22, 9),
45913
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(27, 9),
45919
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T)", "T", "T?").WithLocation(28, 9),
46288
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F1").WithArguments("A.F1<T>(T)", "T", "object?").WithLocation(7, 9),
46294
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T)", "T", "object?").WithLocation(9, 9),
46544
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, out T)", "T", "T?").WithLocation(29, 9),
46550
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, out T?)", "T", "T?").WithLocation(32, 9),
46559
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, out T)", "T", "T?").WithLocation(40, 9),
46565
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, out T?)", "T", "T?").WithLocation(43, 9),
46852
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F1").WithArguments("A.F1<T>(T, out T)", "T", "object?").WithLocation(7, 9),
46858
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T, out T)", "T", "object?").WithLocation(13, 9),
47110
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, ref T)", "T", "T?").WithLocation(39, 9),
47116
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, ref T?)", "T", "T?").WithLocation(43, 9),
47125
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, ref T)", "T", "T?").WithLocation(53, 9),
47134
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, ref T?)", "T", "T?").WithLocation(57, 9),
47340
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(20, 9),
47343
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T)", "T", "T?").WithLocation(21, 9),
47346
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(26, 9),
47349
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T)", "T", "T?").WithLocation(27, 9)
47506
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F1").WithArguments("A.F1<T>(T)", "T", "object?").WithLocation(7, 9),
47512
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T)", "T", "object?").WithLocation(9, 9)
48274
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, out T)", "T", "T?").WithLocation(29, 9),
48277
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, out T?)", "T", "T?").WithLocation(32, 9),
48280
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, out T)", "T", "T?").WithLocation(40, 9),
48283
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, out T?)", "T", "T?").WithLocation(43, 9));
48879
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "t1.E1").WithArguments("Program.E1<T>(T)", "T", "T?").WithLocation(13, 13),
48885
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "t2.E1").WithArguments("Program.E1<T>(T)", "T", "T").WithLocation(19, 13));
64058
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "string?").WithArguments("D<T>", "T", "string?").WithLocation(6, 21),
64073
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "string?").WithArguments("D<T>", "T", "string?").WithLocation(10, 21),
78299
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<string?>").WithArguments("C.M1<T>(T?)", "T", "string?").WithLocation(25, 9),
78308
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<CL0<string?>?>").WithArguments("C.M1<T>(T?)", "T", "CL0<string?>?").WithLocation(35, 9),
84631
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F").WithArguments("C.F<T>((T, T?))", "T", "string?").WithLocation(8, 9),
84637
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F").WithArguments("C.F<T>((T, T?))", "T", "string?").WithLocation(9, 9),
84662
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F").WithArguments("C.F<T>((T, T?))", "T", "string?").WithLocation(8, 9),
84668
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F").WithArguments("C.F<T>((T, T?))", "T", "string?").WithLocation(9, 9),
89977
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "x1").WithArguments("A1<T>", "T", "T?").WithLocation(12, 27),
89986
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "x2").WithArguments("A2<T>", "T", "T?").WithLocation(21, 27),
90256
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "c").WithArguments("C<T>", "T", "T?").WithLocation(10, 28),
90319
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "T?").WithArguments("S<T>", "T", "T?").WithLocation(25, 34),
90328
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "T?").WithArguments("S<T>", "T", "T?").WithLocation(27, 32),
90334
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "T?").WithArguments("S<T>", "T", "T?").WithLocation(29, 33),
90340
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "T?").WithArguments("S<T>", "T", "T?").WithLocation(31, 38),
91885
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "new A<string?>()").WithArguments("Extensions.GetEnumerator<T>(A<T>)", "T", "string?").WithLocation(12, 26),
92386
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "new A<string?>()").WithArguments("Extensions.GetAsyncEnumerator<T>(A<T>)", "T", "string?").WithLocation(12, 32),
93608
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F").WithArguments("C.F<T>(T, T?)", "T", "C?").WithLocation(6, 9),
93614
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F").WithArguments("C.F<T>(T, T?)", "T", "C?").WithLocation(7, 9),
94231
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F").WithArguments("C.F<T>(IOut<T>, IOut<T?>)", "T", "string?").WithLocation(36, 9),
94237
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F").WithArguments("C.F<T>(IOut<T>, IOut<T?>)", "T", "string?").WithLocation(37, 9),
101663
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Property").WithArguments("C<T>", "T", "object?").WithLocation(6, 16),
101666
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Method").WithArguments("C<T>", "T", "object?").WithLocation(7, 16),
101669
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "p").WithArguments("C<T>", "T", "object?").WithLocation(7, 34),
101672
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Field").WithArguments("C<T>", "T", "object?").WithLocation(11, 23),
101675
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "object?").WithArguments("C<T>", "T", "object?").WithLocation(11, 37),
101678
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Property").WithArguments("C<T>", "T", "object?").WithLocation(12, 16),
101681
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Method").WithArguments("C<T>", "T", "object?").WithLocation(13, 16),
101684
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "p").WithArguments("C<T>", "T", "object?").WithLocation(13, 34),
101687
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Property").WithArguments("C<T>", "T", "object?").WithLocation(15, 18),
101690
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Method").WithArguments("C<T>", "T", "object?").WithLocation(16, 18),
101693
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "p").WithArguments("C<T>", "T", "object?").WithLocation(16, 36),
101696
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "object?").WithArguments("C<T>", "T", "object?").WithLocation(19, 12),
101699
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "object?").WithArguments("C<T>", "T", "object?").WithLocation(19, 25));
101732
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "C3<A?>").WithArguments("C3<T>", "T", "A?").WithLocation(10, 14));
101765
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "D6").WithArguments("C3<T>", "T", "A?").WithLocation(10, 7));
107983
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "IB").WithArguments("IA<TA>", "TA", "string?").WithLocation(8, 18),
107986
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "string?").WithArguments("IA<TA>", "TA", "string?").WithLocation(18, 12),
107989
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1").WithArguments("B.M1<TM1>(TM1)", "TM1", "string?").WithLocation(27, 9),
107992
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<string?>").WithArguments("B.M1<TM1>(TM1)", "TM1", "string?").WithLocation(29, 9),
107995
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<string?>").WithArguments("B.M1<TM1>(TM1)", "TM1", "string?").WithLocation(30, 9)
108208
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "IB").WithArguments("IA<TA>", "TA", "TIB").WithLocation(8, 18),
108211
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "TB1").WithArguments("IA<TA>", "TA", "TB1").WithLocation(21, 12),
108214
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1").WithArguments("B<TB1, TB2>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(30, 9),
108217
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<TB1>").WithArguments("B<TB1, TB2>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(32, 9)
108523
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "TB1").WithArguments("IA<TA>", "TA", "TB1").WithLocation(21, 12),
108526
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1").WithArguments("B<TB1, TB2>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(30, 9),
108529
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<TB1>").WithArguments("B<TB1, TB2>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(32, 9)
108574
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "IB").WithArguments("IA<TA>", "TA", "TIB").WithLocation(8, 18),
108577
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "TB1").WithArguments("IA<TA>", "TA", "TB1").WithLocation(18, 12),
108580
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1").WithArguments("B<TB1, TB2>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(27, 9),
108583
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<TB1>").WithArguments("B<TB1, TB2>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(29, 9)
108670
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "TB1").WithArguments("IA<TA>", "TA", "TB1").WithLocation(18, 12),
108673
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1").WithArguments("B<TB1, TB2>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(27, 9),
108676
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<TB1>").WithArguments("B<TB1, TB2>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(29, 9)
108961
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "TB1").WithArguments("IA<TA>", "TA", "TB1").WithLocation(12, 12),
108970
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1").WithArguments("B<TB1>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(20, 9),
108979
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<TB1>").WithArguments("B<TB1>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(21, 9),
111039
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "B3").WithArguments("A<T, U>", "T", "T?").WithLocation(19, 7),
111042
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "B3").WithArguments("I<T, U>", "T", "T?").WithLocation(19, 7),
111045
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "B4").WithArguments("A<T, U>", "T", "T?").WithLocation(23, 7),
111048
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "B4").WithArguments("I<T, U>", "T", "T?").WithLocation(23, 7));
111140
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "object?").WithArguments("C<T, U>", "T", "object?").WithLocation(6, 19),
111143
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "object?").WithArguments("C<T, U>", "T", "object?").WithLocation(7, 19)
111203
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "U").WithArguments("I<T>", "T", "T?").WithLocation(10, 20),
111209
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "U").WithArguments("I<T>", "T", "T?").WithLocation(11, 20),
111801
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "B4").WithArguments("A<T>", "T", "string?").WithLocation(27, 7)
111812
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "B4").WithArguments("A<T>", "T", "string?").WithLocation(27, 7)
112225
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "T").WithArguments("A1<T, U>", "U", "T?").WithLocation(5, 10),
112231
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "T").WithArguments("A2<T, U>", "T", "T?").WithLocation(7, 10));
112810
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "string?").WithArguments("A2<T>", "T", "string?").WithLocation(5, 16),
118264
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1").WithArguments("Outer.M1<T>(T)", "T", "T").WithLocation(6, 9),
118267
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<T>").WithArguments("Outer.M1<T>(T)", "T", "T").WithLocation(7, 9)
118292
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1").WithArguments("Outer.M1<T>(T)", "T", "T").WithLocation(7, 9),
118295
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<T>").WithArguments("Outer.M1<T>(T)", "T", "T").WithLocation(8, 9)
134278
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "p").WithArguments("E.Deconstruct<T, U>(Pair<T, U>, out T, out U)", "T", "object?").WithLocation(14, 22),
134323
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "p").WithArguments("E.Deconstruct<T, U>(Pair<T, U>, out T, out U)", "T", "object?").WithLocation(21, 27),
134326
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "p").WithArguments("E.Deconstruct<T, U>(Pair2<T, U>, out T, out U)", "U", "object?").WithLocation(21, 27),
138952
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F<U>").WithArguments("C.F<T>(I<T>)", "T", "U").WithLocation(16, 9),
141600
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "y.F").WithArguments("E.F<T>(T)", "T", "T?").WithLocation(14, 13),
141603
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "y.F").WithArguments("E.F<T>(T)", "T", "T?").WithLocation(16, 23));
145048
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Interlocked.CompareExchange").WithArguments("System.Threading.Interlocked.CompareExchange<T>(ref T, T, T)", "T", "object?").WithLocation(15, 9));
158060
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "FieldItem").WithArguments("C.AuditedItem<T>", "T", "object?").WithLocation(13, 19),
158063
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "FieldItem").WithArguments("C.AuditedItem<T>", "T", "object?").WithLocation(13, 19),
158066
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "FieldItem").WithArguments("C.AuditedItem<T>", "T", "object?").WithLocation(13, 19)
Semantics\RecordStructTests.cs (2)
3004
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "string?").WithArguments("R<T>", "T", "string?").WithLocation(3, 15),
3007
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "string?").WithArguments("R2<T>", "T", "string?").WithLocation(4, 17)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Diagnostics\DiagnosticTest.cs (1)
362
case ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
: