25 references to ERR_UnsafeConstructorConstraint
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder_Unsafe.cs (1)
112
CallerUnsafeMode.Explicit => forConstructorConstraint ? ErrorCode.
ERR_UnsafeConstructorConstraint
: ErrorCode.ERR_UnsafeMemberOperation,
Errors\ErrorFacts.cs (1)
2590
or ErrorCode.
ERR_UnsafeConstructorConstraint
Microsoft.CodeAnalysis.CSharp.CSharp15.UnitTests (23)
UnsafeEvolutionTests.cs (23)
6365
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "X").WithArguments("C.C()", "T", "D<T>").WithLocation(1, 7),
6368
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "C.M<C>()").WithArguments("C.C()", "T", "C.M<T>()").WithLocation(2, 1),
6371
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "D<C>").WithArguments("C.C()", "T", "D<T>").WithLocation(3, 9),
6413
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "c.P1").WithArguments("C.C()", "T", "E.extension<T>(T).P1.get").WithLocation(2, 5),
6416
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "C.P2").WithArguments("C.C()", "T", "E.extension<T>(T).P2.get").WithLocation(3, 5),
6449
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "M1<int, C, int>()").WithArguments("C.C()", "T2", "M1<T1, T2, T3>()").WithLocation(2, 1),
6452
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "M2<C, C, C>(null, null, null)").WithArguments("C.C()", "T1", "M2<T1, T2, T3>(T1, T2, T3)").WithLocation(3, 1),
6455
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "M2<C, C, C>(null, null, null)").WithArguments("C.C()", "T3", "M2<T1, T2, T3>(T1, T2, T3)").WithLocation(3, 1),
6458
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "M2(c, c, c)").WithArguments("C.C()", "T1", "M2<T1, T2, T3>(T1, T2, T3)").WithLocation(6, 1),
6461
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "M2(c, c, c)").WithArguments("C.C()", "T3", "M2<T1, T2, T3>(T1, T2, T3)").WithLocation(6, 1),
6490
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "M<C2>()").WithArguments("C2.C2()", "T", "M<T>()").WithLocation(2, 1),
6533
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "D1<C>").WithArguments("C.C()", "T", "D1<T>").WithLocation(1, 14),
6536
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "X1").WithArguments("C.C()", "T", "D1<T>").WithLocation(3, 7),
6539
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "D1<C>").WithArguments("C.C()", "T", "D1<T>").WithLocation(10, 1),
6542
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "D2<C>").WithArguments("C.C()", "T", "D2<T>").WithLocation(16, 1),
6572
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "N.D<C>").WithArguments("C.C()", "T", "N.D<T>").WithLocation(1, 1),
6575
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "N.D<C>").WithArguments("C.C()", "T", "N.D<T>").WithLocation(1, 16),
6605
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "D<C>").WithArguments("C.C()", "T", "D<T>").WithLocation(1, 1),
6608
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "D<C>").WithArguments("C.C()", "T", "D<T>").WithLocation(1, 21),
6638
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "D.Nested<C>").WithArguments("C.C()", "T", "D.Nested<T>").WithLocation(1, 1),
6641
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "D.Nested<C>").WithArguments("C.C()", "T", "D.Nested<T>").WithLocation(1, 21),
6677
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "S<C>").WithArguments("C.C()", "T", "S<T>").WithLocation(2, 15),
6680
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "S<C>").WithArguments("C.C()", "T", "S<T>").WithLocation(5, 11),