@@ -44324,6 +44325,9 @@ public void Test2(TB1 a2, TB2 b2)
";
var comp1 = CreateCompilation(new[] { source, NonNullTypesTrue });
// https://github.com/dotnet/roslyn/issues/29678: Constraint violations are not reported for type references outside of method bodies.
// https://github.com/dotnet/roslyn/issues/30214 The following warning is unexpected:
// (22,12): warning CS8631: The type 'TB2' cannot be used as type parameter 'TA' in the generic type or method 'IA<TA>'. Nullability of type argument 'TB2' doesn't match constraint type 'object'.
// (21,12): warning CS8631: The type 'TB1' cannot be used as type parameter 'TA' in the generic type or method 'IA<TA>'. Nullability of type argument 'TB1' doesn't match constraint type 'object'.
// (37,9): warning CS8631: The type 'T1' cannot be used as type parameter 'T' in the generic type or method 'C.Test<T>()'. Nullability of type argument 'T1' doesn't match constraint type 'object'.
// (38,9): warning CS8631: The type 'T2' cannot be used as type parameter 'T' in the generic type or method 'C.Test<T>()'. Nullability of type argument 'T2' doesn't match constraint type 'object'.
// (39,9): warning CS8631: The type 'T3' cannot be used as type parameter 'T' in the generic type or method 'C.Test<T>()'. Nullability of type argument 'T3' doesn't match constraint type 'object'.
// https://github.com/dotnet/roslyn/issues/30220: Missing warnings for
// B<T1?> b1;
// A<T1>.B<T1?> d1;
comp.VerifyDiagnostics(
// (22,16): warning CS8631: The type 'C?' cannot be used as type parameter 'T2' in the generic type or method 'A<C>.B<T2>'. Nullability of type argument 'C?' doesn't match constraint type 'C'.