165 references to WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
Microsoft.CodeAnalysis.CSharp (5)
Errors\ErrorFacts.cs (3)
41
nullableWarnings.Add(GetId(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
));
462
case ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
:
1976
or ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
Generated\ErrorFacts.Generated.cs (1)
222
case ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
:
Symbols\ConstraintsHelper.cs (1)
1160
nullabilityDiagnosticsBuilderOpt.Add(new TypeParameterDiagnosticInfo(typeParameter, new UseSiteInfo<AssemblySymbol>(new CSDiagnosticInfo(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, containingSymbol.ConstructedFrom(), typeParameter, typeArgument))));
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (6)
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)
9648
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "--x").WithArguments("Extensions1.extension<T>(T)", "T", "C2?").WithLocation(19, 10),
26350
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "x -= 1").WithArguments("Extensions1.extension<T>(T)", "T", "C2?").WithLocation(19, 10),
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)
3076
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "new C().M<object?>").WithArguments("C.M<T>()", "T", "object?").WithLocation(2, 9)
Semantics\NullableReferenceTypesTests.cs (150)
8431
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "string?").WithArguments("C<T>", "T", "string?").WithLocation(18, 25),
8434
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "x").WithArguments("C<T>", "T", "string?").WithLocation(34, 33),
8437
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "string?").WithArguments("C<T>", "T", "string?").WithLocation(35, 35),
8443
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "string?").WithArguments("C<T>", "T", "string?").WithLocation(37, 29),
8446
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "D2").WithArguments("C<T>", "T", "string?").WithLocation(39, 11),
8449
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "+").WithArguments("C<T>", "T", "T?").WithLocation(40, 34),
8452
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "y").WithArguments("C<T>", "T", "T?").WithLocation(40, 50),
8455
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "x").WithArguments("C<T>", "T", "T?").WithLocation(43, 18),
8458
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "x").WithArguments("C<T>", "T", "string?").WithLocation(45, 36)
28772
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, out T)", "T", "T?").WithLocation(34, 13),
28781
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, out T?)", "T", "T?").WithLocation(38, 13),
28796
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, out T)", "T", "T?").WithLocation(48, 13),
28805
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, out T?)", "T", "T?").WithLocation(52, 13),
31690
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, out T)", "T", "T?").WithLocation(34, 13),
31696
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, out T?)", "T", "T?").WithLocation(38, 13),
31705
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, out T)", "T", "T?").WithLocation(48, 13),
31711
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, out T?)", "T", "T?").WithLocation(52, 13),
35194
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "CopyOrDefault").WithArguments("C.CopyOrDefault<T>(T, out T?)", "T", "string?").WithLocation(6, 9),
35270
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "CopyOrDefault").WithArguments("C.CopyOrDefault<T>(T, out T?[])", "T", "string?").WithLocation(6, 9),
36363
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Copy").WithArguments("C.Copy<T>(T, out T?)", "T", "string?").WithLocation(7, 9)
36575
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Copy").WithArguments("C.Copy<T>(T)", "T", "string?").WithLocation(6, 17),
40077
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(20, 9),
40080
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(26, 9));
40330
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F1").WithArguments("A.F1<T>(T)", "T", "object?").WithLocation(7, 9),
40333
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T)", "T", "object?").WithLocation(9, 9));
41166
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F1").WithArguments("A.F1<T>(T, T)", "T", "object?").WithLocation(10, 9),
41169
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F1").WithArguments("A.F1<T>(T, T)", "T", "object?").WithLocation(11, 9),
41172
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F1").WithArguments("A.F1<T>(T, T)", "T", "object?").WithLocation(13, 9),
41175
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T, T)", "T", "object?").WithLocation(15, 9),
41178
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T, T)", "T", "object?").WithLocation(16, 9),
41181
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T, T)", "T", "object?").WithLocation(18, 9),
41184
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T, T)", "T", "object?").WithLocation(20, 9),
41187
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T, T)", "T", "object?").WithLocation(21, 9)
43900
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(21, 16),
43912
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(27, 16),
44089
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(21, 16),
44101
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(27, 16),
45869
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(21, 9),
45875
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T)", "T", "T?").WithLocation(22, 9),
45884
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(27, 9),
45890
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T)", "T", "T?").WithLocation(28, 9),
46259
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F1").WithArguments("A.F1<T>(T)", "T", "object?").WithLocation(7, 9),
46265
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T)", "T", "object?").WithLocation(9, 9),
46515
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, out T)", "T", "T?").WithLocation(29, 9),
46521
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, out T?)", "T", "T?").WithLocation(32, 9),
46530
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, out T)", "T", "T?").WithLocation(40, 9),
46536
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, out T?)", "T", "T?").WithLocation(43, 9),
46823
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F1").WithArguments("A.F1<T>(T, out T)", "T", "object?").WithLocation(7, 9),
46829
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T, out T)", "T", "object?").WithLocation(13, 9),
47081
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, ref T)", "T", "T?").WithLocation(39, 9),
47087
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, ref T?)", "T", "T?").WithLocation(43, 9),
47096
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, ref T)", "T", "T?").WithLocation(53, 9),
47105
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, ref T?)", "T", "T?").WithLocation(57, 9),
47311
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(20, 9),
47314
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T)", "T", "T?").WithLocation(21, 9),
47317
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(26, 9),
47320
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T)", "T", "T?").WithLocation(27, 9)
47477
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F1").WithArguments("A.F1<T>(T)", "T", "object?").WithLocation(7, 9),
47483
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T)", "T", "object?").WithLocation(9, 9)
48245
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, out T)", "T", "T?").WithLocation(29, 9),
48248
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, out T?)", "T", "T?").WithLocation(32, 9),
48251
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, out T)", "T", "T?").WithLocation(40, 9),
48254
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, out T?)", "T", "T?").WithLocation(43, 9));
48850
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "t1.E1").WithArguments("Program.E1<T>(T)", "T", "T?").WithLocation(13, 13),
48856
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "t2.E1").WithArguments("Program.E1<T>(T)", "T", "T").WithLocation(19, 13));
64017
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "string?").WithArguments("D<T>", "T", "string?").WithLocation(6, 21),
64032
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "string?").WithArguments("D<T>", "T", "string?").WithLocation(10, 21),
78235
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<string?>").WithArguments("C.M1<T>(T?)", "T", "string?").WithLocation(25, 9),
78244
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<CL0<string?>?>").WithArguments("C.M1<T>(T?)", "T", "CL0<string?>?").WithLocation(35, 9),
84569
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F").WithArguments("C.F<T>((T, T?))", "T", "string?").WithLocation(8, 9),
84575
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F").WithArguments("C.F<T>((T, T?))", "T", "string?").WithLocation(9, 9),
84600
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F").WithArguments("C.F<T>((T, T?))", "T", "string?").WithLocation(8, 9),
84606
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F").WithArguments("C.F<T>((T, T?))", "T", "string?").WithLocation(9, 9),
89915
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "x1").WithArguments("A1<T>", "T", "T?").WithLocation(12, 27),
89924
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "x2").WithArguments("A2<T>", "T", "T?").WithLocation(21, 27),
90194
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "c").WithArguments("C<T>", "T", "T?").WithLocation(10, 28),
90257
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "T?").WithArguments("S<T>", "T", "T?").WithLocation(25, 34),
90266
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "T?").WithArguments("S<T>", "T", "T?").WithLocation(27, 32),
90272
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "T?").WithArguments("S<T>", "T", "T?").WithLocation(29, 33),
90278
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "T?").WithArguments("S<T>", "T", "T?").WithLocation(31, 38),
91801
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "new A<string?>()").WithArguments("Extensions.GetEnumerator<T>(A<T>)", "T", "string?").WithLocation(12, 26),
92302
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "new A<string?>()").WithArguments("Extensions.GetAsyncEnumerator<T>(A<T>)", "T", "string?").WithLocation(12, 32),
93524
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F").WithArguments("C.F<T>(T, T?)", "T", "C?").WithLocation(6, 9),
93530
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F").WithArguments("C.F<T>(T, T?)", "T", "C?").WithLocation(7, 9),
94147
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F").WithArguments("C.F<T>(IOut<T>, IOut<T?>)", "T", "string?").WithLocation(36, 9),
94153
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F").WithArguments("C.F<T>(IOut<T>, IOut<T?>)", "T", "string?").WithLocation(37, 9),
101579
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Property").WithArguments("C<T>", "T", "object?").WithLocation(6, 16),
101582
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Method").WithArguments("C<T>", "T", "object?").WithLocation(7, 16),
101585
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "p").WithArguments("C<T>", "T", "object?").WithLocation(7, 34),
101588
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Field").WithArguments("C<T>", "T", "object?").WithLocation(11, 23),
101591
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "object?").WithArguments("C<T>", "T", "object?").WithLocation(11, 37),
101594
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Property").WithArguments("C<T>", "T", "object?").WithLocation(12, 16),
101597
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Method").WithArguments("C<T>", "T", "object?").WithLocation(13, 16),
101600
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "p").WithArguments("C<T>", "T", "object?").WithLocation(13, 34),
101603
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Property").WithArguments("C<T>", "T", "object?").WithLocation(15, 18),
101606
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Method").WithArguments("C<T>", "T", "object?").WithLocation(16, 18),
101609
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "p").WithArguments("C<T>", "T", "object?").WithLocation(16, 36),
101612
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "object?").WithArguments("C<T>", "T", "object?").WithLocation(19, 12),
101615
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "object?").WithArguments("C<T>", "T", "object?").WithLocation(19, 25));
101648
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "C3<A?>").WithArguments("C3<T>", "T", "A?").WithLocation(10, 14));
101681
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "D6").WithArguments("C3<T>", "T", "A?").WithLocation(10, 7));
107899
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "IB").WithArguments("IA<TA>", "TA", "string?").WithLocation(8, 18),
107902
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "string?").WithArguments("IA<TA>", "TA", "string?").WithLocation(18, 12),
107905
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1").WithArguments("B.M1<TM1>(TM1)", "TM1", "string?").WithLocation(27, 9),
107908
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<string?>").WithArguments("B.M1<TM1>(TM1)", "TM1", "string?").WithLocation(29, 9),
107911
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<string?>").WithArguments("B.M1<TM1>(TM1)", "TM1", "string?").WithLocation(30, 9)
108124
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "IB").WithArguments("IA<TA>", "TA", "TIB").WithLocation(8, 18),
108127
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "TB1").WithArguments("IA<TA>", "TA", "TB1").WithLocation(21, 12),
108130
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1").WithArguments("B<TB1, TB2>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(30, 9),
108133
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<TB1>").WithArguments("B<TB1, TB2>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(32, 9)
108439
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "TB1").WithArguments("IA<TA>", "TA", "TB1").WithLocation(21, 12),
108442
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1").WithArguments("B<TB1, TB2>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(30, 9),
108445
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<TB1>").WithArguments("B<TB1, TB2>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(32, 9)
108490
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "IB").WithArguments("IA<TA>", "TA", "TIB").WithLocation(8, 18),
108493
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "TB1").WithArguments("IA<TA>", "TA", "TB1").WithLocation(18, 12),
108496
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1").WithArguments("B<TB1, TB2>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(27, 9),
108499
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<TB1>").WithArguments("B<TB1, TB2>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(29, 9)
108586
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "TB1").WithArguments("IA<TA>", "TA", "TB1").WithLocation(18, 12),
108589
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1").WithArguments("B<TB1, TB2>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(27, 9),
108592
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<TB1>").WithArguments("B<TB1, TB2>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(29, 9)
108877
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "TB1").WithArguments("IA<TA>", "TA", "TB1").WithLocation(12, 12),
108886
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1").WithArguments("B<TB1>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(20, 9),
108895
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<TB1>").WithArguments("B<TB1>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(21, 9),
110955
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "B3").WithArguments("A<T, U>", "T", "T?").WithLocation(19, 7),
110958
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "B3").WithArguments("I<T, U>", "T", "T?").WithLocation(19, 7),
110961
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "B4").WithArguments("A<T, U>", "T", "T?").WithLocation(23, 7),
110964
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "B4").WithArguments("I<T, U>", "T", "T?").WithLocation(23, 7));
111056
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "object?").WithArguments("C<T, U>", "T", "object?").WithLocation(6, 19),
111059
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "object?").WithArguments("C<T, U>", "T", "object?").WithLocation(7, 19)
111119
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "U").WithArguments("I<T>", "T", "T?").WithLocation(10, 20),
111125
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "U").WithArguments("I<T>", "T", "T?").WithLocation(11, 20),
111717
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "B4").WithArguments("A<T>", "T", "string?").WithLocation(27, 7)
111728
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "B4").WithArguments("A<T>", "T", "string?").WithLocation(27, 7)
112141
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "T").WithArguments("A1<T, U>", "U", "T?").WithLocation(5, 10),
112147
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "T").WithArguments("A2<T, U>", "T", "T?").WithLocation(7, 10));
112726
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "string?").WithArguments("A2<T>", "T", "string?").WithLocation(5, 16),
118180
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1").WithArguments("Outer.M1<T>(T)", "T", "T").WithLocation(6, 9),
118183
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<T>").WithArguments("Outer.M1<T>(T)", "T", "T").WithLocation(7, 9)
118208
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1").WithArguments("Outer.M1<T>(T)", "T", "T").WithLocation(7, 9),
118211
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<T>").WithArguments("Outer.M1<T>(T)", "T", "T").WithLocation(8, 9)
134197
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "p").WithArguments("E.Deconstruct<T, U>(Pair<T, U>, out T, out U)", "T", "object?").WithLocation(14, 22),
134242
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "p").WithArguments("E.Deconstruct<T, U>(Pair<T, U>, out T, out U)", "T", "object?").WithLocation(21, 27),
134245
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "p").WithArguments("E.Deconstruct<T, U>(Pair2<T, U>, out T, out U)", "U", "object?").WithLocation(21, 27),
138871
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F<U>").WithArguments("C.F<T>(I<T>)", "T", "U").WithLocation(16, 9),
141519
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "y.F").WithArguments("E.F<T>(T)", "T", "T?").WithLocation(14, 13),
141522
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "y.F").WithArguments("E.F<T>(T)", "T", "T?").WithLocation(16, 23));
144967
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Interlocked.CompareExchange").WithArguments("System.Threading.Interlocked.CompareExchange<T>(ref T, T, T)", "T", "object?").WithLocation(15, 9));
157945
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "FieldItem").WithArguments("C.AuditedItem<T>", "T", "object?").WithLocation(13, 19),
157948
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "FieldItem").WithArguments("C.AuditedItem<T>", "T", "object?").WithLocation(13, 19),
157951
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)
374
case ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
: