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
:
1975
or ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
Generated\ErrorFacts.Generated.cs (1)
221
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 (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)
9691
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "--x").WithArguments("Extensions1.extension<T>(T)", "T", "C2?").WithLocation(19, 10),
26477
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "x -= 1").WithArguments("Extensions1.extension<T>(T)", "T", "C2?").WithLocation(19, 10),
Semantics\ExtensionTests2.cs (1)
2572
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)
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)
28773
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, out T)", "T", "T?").WithLocation(34, 13),
28782
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, out T?)", "T", "T?").WithLocation(38, 13),
28797
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, out T)", "T", "T?").WithLocation(48, 13),
28806
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, out T?)", "T", "T?").WithLocation(52, 13),
31691
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, out T)", "T", "T?").WithLocation(34, 13),
31697
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, out T?)", "T", "T?").WithLocation(38, 13),
31706
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, out T)", "T", "T?").WithLocation(48, 13),
31712
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, out T?)", "T", "T?").WithLocation(52, 13),
35195
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "CopyOrDefault").WithArguments("C.CopyOrDefault<T>(T, out T?)", "T", "string?").WithLocation(6, 9),
35271
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "CopyOrDefault").WithArguments("C.CopyOrDefault<T>(T, out T?[])", "T", "string?").WithLocation(6, 9),
36364
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Copy").WithArguments("C.Copy<T>(T, out T?)", "T", "string?").WithLocation(7, 9)
36576
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Copy").WithArguments("C.Copy<T>(T)", "T", "string?").WithLocation(6, 17),
40078
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(20, 9),
40081
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(26, 9));
40331
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F1").WithArguments("A.F1<T>(T)", "T", "object?").WithLocation(7, 9),
40334
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T)", "T", "object?").WithLocation(9, 9));
41167
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F1").WithArguments("A.F1<T>(T, T)", "T", "object?").WithLocation(10, 9),
41170
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F1").WithArguments("A.F1<T>(T, T)", "T", "object?").WithLocation(11, 9),
41173
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F1").WithArguments("A.F1<T>(T, T)", "T", "object?").WithLocation(13, 9),
41176
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T, T)", "T", "object?").WithLocation(15, 9),
41179
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T, T)", "T", "object?").WithLocation(16, 9),
41182
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T, T)", "T", "object?").WithLocation(18, 9),
41185
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T, T)", "T", "object?").WithLocation(20, 9),
41188
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T, T)", "T", "object?").WithLocation(21, 9)
43901
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(21, 16),
43913
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(27, 16),
44090
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(21, 16),
44102
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(27, 16),
45870
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(21, 9),
45876
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T)", "T", "T?").WithLocation(22, 9),
45885
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(27, 9),
45891
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T)", "T", "T?").WithLocation(28, 9),
46260
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F1").WithArguments("A.F1<T>(T)", "T", "object?").WithLocation(7, 9),
46266
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T)", "T", "object?").WithLocation(9, 9),
46516
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, out T)", "T", "T?").WithLocation(29, 9),
46522
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, out T?)", "T", "T?").WithLocation(32, 9),
46531
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, out T)", "T", "T?").WithLocation(40, 9),
46537
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, out T?)", "T", "T?").WithLocation(43, 9),
46824
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F1").WithArguments("A.F1<T>(T, out T)", "T", "object?").WithLocation(7, 9),
46830
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T, out T)", "T", "object?").WithLocation(13, 9),
47082
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, ref T)", "T", "T?").WithLocation(39, 9),
47088
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, ref T?)", "T", "T?").WithLocation(43, 9),
47097
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, ref T)", "T", "T?").WithLocation(53, 9),
47106
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, ref T?)", "T", "T?").WithLocation(57, 9),
47312
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(20, 9),
47315
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T)", "T", "T?").WithLocation(21, 9),
47318
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T)", "T", "T?").WithLocation(26, 9),
47321
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T)", "T", "T?").WithLocation(27, 9)
47478
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F1").WithArguments("A.F1<T>(T)", "T", "object?").WithLocation(7, 9),
47484
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("A.F2<T>(T)", "T", "object?").WithLocation(9, 9)
48246
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, out T)", "T", "T?").WithLocation(29, 9),
48249
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, out T?)", "T", "T?").WithLocation(32, 9),
48252
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F2").WithArguments("Program.F2<T>(T, out T)", "T", "T?").WithLocation(40, 9),
48255
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F3").WithArguments("Program.F3<T>(T, out T?)", "T", "T?").WithLocation(43, 9));
48851
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "t1.E1").WithArguments("Program.E1<T>(T)", "T", "T?").WithLocation(13, 13),
48857
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "t2.E1").WithArguments("Program.E1<T>(T)", "T", "T").WithLocation(19, 13));
64018
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "string?").WithArguments("D<T>", "T", "string?").WithLocation(6, 21),
64033
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "string?").WithArguments("D<T>", "T", "string?").WithLocation(10, 21),
78259
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<string?>").WithArguments("C.M1<T>(T?)", "T", "string?").WithLocation(25, 9),
78268
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<CL0<string?>?>").WithArguments("C.M1<T>(T?)", "T", "CL0<string?>?").WithLocation(35, 9),
84591
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F").WithArguments("C.F<T>((T, T?))", "T", "string?").WithLocation(8, 9),
84597
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F").WithArguments("C.F<T>((T, T?))", "T", "string?").WithLocation(9, 9),
84622
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F").WithArguments("C.F<T>((T, T?))", "T", "string?").WithLocation(8, 9),
84628
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F").WithArguments("C.F<T>((T, T?))", "T", "string?").WithLocation(9, 9),
89937
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "x1").WithArguments("A1<T>", "T", "T?").WithLocation(12, 27),
89946
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "x2").WithArguments("A2<T>", "T", "T?").WithLocation(21, 27),
90216
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "c").WithArguments("C<T>", "T", "T?").WithLocation(10, 28),
90279
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "T?").WithArguments("S<T>", "T", "T?").WithLocation(25, 34),
90288
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "T?").WithArguments("S<T>", "T", "T?").WithLocation(27, 32),
90294
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "T?").WithArguments("S<T>", "T", "T?").WithLocation(29, 33),
90300
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "T?").WithArguments("S<T>", "T", "T?").WithLocation(31, 38),
91823
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "new A<string?>()").WithArguments("Extensions.GetEnumerator<T>(A<T>)", "T", "string?").WithLocation(12, 26),
92324
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "new A<string?>()").WithArguments("Extensions.GetAsyncEnumerator<T>(A<T>)", "T", "string?").WithLocation(12, 32),
93546
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F").WithArguments("C.F<T>(T, T?)", "T", "C?").WithLocation(6, 9),
93552
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F").WithArguments("C.F<T>(T, T?)", "T", "C?").WithLocation(7, 9),
94169
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F").WithArguments("C.F<T>(IOut<T>, IOut<T?>)", "T", "string?").WithLocation(36, 9),
94175
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F").WithArguments("C.F<T>(IOut<T>, IOut<T?>)", "T", "string?").WithLocation(37, 9),
101601
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Property").WithArguments("C<T>", "T", "object?").WithLocation(6, 16),
101604
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Method").WithArguments("C<T>", "T", "object?").WithLocation(7, 16),
101607
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "p").WithArguments("C<T>", "T", "object?").WithLocation(7, 34),
101610
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Field").WithArguments("C<T>", "T", "object?").WithLocation(11, 23),
101613
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "object?").WithArguments("C<T>", "T", "object?").WithLocation(11, 37),
101616
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Property").WithArguments("C<T>", "T", "object?").WithLocation(12, 16),
101619
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Method").WithArguments("C<T>", "T", "object?").WithLocation(13, 16),
101622
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "p").WithArguments("C<T>", "T", "object?").WithLocation(13, 34),
101625
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Property").WithArguments("C<T>", "T", "object?").WithLocation(15, 18),
101628
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Method").WithArguments("C<T>", "T", "object?").WithLocation(16, 18),
101631
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "p").WithArguments("C<T>", "T", "object?").WithLocation(16, 36),
101634
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "object?").WithArguments("C<T>", "T", "object?").WithLocation(19, 12),
101637
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "object?").WithArguments("C<T>", "T", "object?").WithLocation(19, 25));
101670
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "C3<A?>").WithArguments("C3<T>", "T", "A?").WithLocation(10, 14));
101703
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "D6").WithArguments("C3<T>", "T", "A?").WithLocation(10, 7));
107921
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "IB").WithArguments("IA<TA>", "TA", "string?").WithLocation(8, 18),
107924
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "string?").WithArguments("IA<TA>", "TA", "string?").WithLocation(18, 12),
107927
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1").WithArguments("B.M1<TM1>(TM1)", "TM1", "string?").WithLocation(27, 9),
107930
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<string?>").WithArguments("B.M1<TM1>(TM1)", "TM1", "string?").WithLocation(29, 9),
107933
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<string?>").WithArguments("B.M1<TM1>(TM1)", "TM1", "string?").WithLocation(30, 9)
108146
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "IB").WithArguments("IA<TA>", "TA", "TIB").WithLocation(8, 18),
108149
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "TB1").WithArguments("IA<TA>", "TA", "TB1").WithLocation(21, 12),
108152
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1").WithArguments("B<TB1, TB2>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(30, 9),
108155
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<TB1>").WithArguments("B<TB1, TB2>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(32, 9)
108461
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "TB1").WithArguments("IA<TA>", "TA", "TB1").WithLocation(21, 12),
108464
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1").WithArguments("B<TB1, TB2>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(30, 9),
108467
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<TB1>").WithArguments("B<TB1, TB2>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(32, 9)
108512
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "IB").WithArguments("IA<TA>", "TA", "TIB").WithLocation(8, 18),
108515
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "TB1").WithArguments("IA<TA>", "TA", "TB1").WithLocation(18, 12),
108518
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1").WithArguments("B<TB1, TB2>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(27, 9),
108521
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<TB1>").WithArguments("B<TB1, TB2>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(29, 9)
108608
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "TB1").WithArguments("IA<TA>", "TA", "TB1").WithLocation(18, 12),
108611
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1").WithArguments("B<TB1, TB2>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(27, 9),
108614
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<TB1>").WithArguments("B<TB1, TB2>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(29, 9)
108899
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "TB1").WithArguments("IA<TA>", "TA", "TB1").WithLocation(12, 12),
108908
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1").WithArguments("B<TB1>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(20, 9),
108917
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<TB1>").WithArguments("B<TB1>.M1<TM1>(TM1)", "TM1", "TB1").WithLocation(21, 9),
110977
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "B3").WithArguments("A<T, U>", "T", "T?").WithLocation(19, 7),
110980
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "B3").WithArguments("I<T, U>", "T", "T?").WithLocation(19, 7),
110983
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "B4").WithArguments("A<T, U>", "T", "T?").WithLocation(23, 7),
110986
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "B4").WithArguments("I<T, U>", "T", "T?").WithLocation(23, 7));
111078
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "object?").WithArguments("C<T, U>", "T", "object?").WithLocation(6, 19),
111081
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "object?").WithArguments("C<T, U>", "T", "object?").WithLocation(7, 19)
111141
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "U").WithArguments("I<T>", "T", "T?").WithLocation(10, 20),
111147
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "U").WithArguments("I<T>", "T", "T?").WithLocation(11, 20),
111739
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "B4").WithArguments("A<T>", "T", "string?").WithLocation(27, 7)
111750
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "B4").WithArguments("A<T>", "T", "string?").WithLocation(27, 7)
112163
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "T").WithArguments("A1<T, U>", "U", "T?").WithLocation(5, 10),
112169
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "T").WithArguments("A2<T, U>", "T", "T?").WithLocation(7, 10));
112748
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "string?").WithArguments("A2<T>", "T", "string?").WithLocation(5, 16),
118202
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1").WithArguments("Outer.M1<T>(T)", "T", "T").WithLocation(6, 9),
118205
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<T>").WithArguments("Outer.M1<T>(T)", "T", "T").WithLocation(7, 9)
118230
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1").WithArguments("Outer.M1<T>(T)", "T", "T").WithLocation(7, 9),
118233
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "M1<T>").WithArguments("Outer.M1<T>(T)", "T", "T").WithLocation(8, 9)
134216
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "p").WithArguments("E.Deconstruct<T, U>(Pair<T, U>, out T, out U)", "T", "object?").WithLocation(14, 22),
134261
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "p").WithArguments("E.Deconstruct<T, U>(Pair<T, U>, out T, out U)", "T", "object?").WithLocation(21, 27),
134264
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "p").WithArguments("E.Deconstruct<T, U>(Pair2<T, U>, out T, out U)", "U", "object?").WithLocation(21, 27),
138890
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "F<U>").WithArguments("C.F<T>(I<T>)", "T", "U").WithLocation(16, 9),
141538
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "y.F").WithArguments("E.F<T>(T)", "T", "T?").WithLocation(14, 13),
141541
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "y.F").WithArguments("E.F<T>(T)", "T", "T?").WithLocation(16, 23));
144986
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "Interlocked.CompareExchange").WithArguments("System.Threading.Interlocked.CompareExchange<T>(ref T, T, T)", "T", "object?").WithLocation(15, 9));
157998
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "FieldItem").WithArguments("C.AuditedItem<T>", "T", "object?").WithLocation(13, 19),
158001
Diagnostic(ErrorCode.
WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint
, "FieldItem").WithArguments("C.AuditedItem<T>", "T", "object?").WithLocation(13, 19),
158004
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
: