25 references to ERR_UnsafeConstructorConstraint
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder_Unsafe.cs (1)
114
CallerUnsafeMode.Explicit => forConstructorConstraint ? ErrorCode.
ERR_UnsafeConstructorConstraint
: ErrorCode.ERR_UnsafeMemberOperation,
Errors\ErrorFacts.cs (1)
2591
or ErrorCode.
ERR_UnsafeConstructorConstraint
Microsoft.CodeAnalysis.CSharp.CSharp15.UnitTests (23)
UnsafeEvolutionTests.cs (23)
7392
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "X").WithArguments("C.C()", "T", "D<T>").WithLocation(1, 7),
7395
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "C.M<C>()").WithArguments("C.C()", "T", "C.M<T>()").WithLocation(2, 1),
7398
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "D<C>").WithArguments("C.C()", "T", "D<T>").WithLocation(3, 9),
7440
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "c.P1").WithArguments("C.C()", "T", "E.extension<T>(T).P1.get").WithLocation(2, 5),
7443
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "C.P2").WithArguments("C.C()", "T", "E.extension<T>(T).P2.get").WithLocation(3, 5),
7476
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "M1<int, C, int>()").WithArguments("C.C()", "T2", "M1<T1, T2, T3>()").WithLocation(2, 1),
7479
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),
7482
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),
7485
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "M2(c, c, c)").WithArguments("C.C()", "T1", "M2<T1, T2, T3>(T1, T2, T3)").WithLocation(6, 1),
7488
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "M2(c, c, c)").WithArguments("C.C()", "T3", "M2<T1, T2, T3>(T1, T2, T3)").WithLocation(6, 1),
7517
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "M<C2>()").WithArguments("C2.C2()", "T", "M<T>()").WithLocation(2, 1),
7560
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "D1<C>").WithArguments("C.C()", "T", "D1<T>").WithLocation(1, 14),
7563
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "X1").WithArguments("C.C()", "T", "D1<T>").WithLocation(3, 7),
7566
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "D1<C>").WithArguments("C.C()", "T", "D1<T>").WithLocation(10, 1),
7569
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "D2<C>").WithArguments("C.C()", "T", "D2<T>").WithLocation(16, 1),
7599
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "N.D<C>").WithArguments("C.C()", "T", "N.D<T>").WithLocation(1, 1),
7602
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "N.D<C>").WithArguments("C.C()", "T", "N.D<T>").WithLocation(1, 16),
7632
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "D<C>").WithArguments("C.C()", "T", "D<T>").WithLocation(1, 1),
7635
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "D<C>").WithArguments("C.C()", "T", "D<T>").WithLocation(1, 21),
7665
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "D.Nested<C>").WithArguments("C.C()", "T", "D.Nested<T>").WithLocation(1, 1),
7668
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "D.Nested<C>").WithArguments("C.C()", "T", "D.Nested<T>").WithLocation(1, 21),
7704
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "S<C>").WithArguments("C.C()", "T", "S<T>").WithLocation(2, 15),
7707
Diagnostic(ErrorCode.
ERR_UnsafeConstructorConstraint
, "S<C>").WithArguments("C.C()", "T", "S<T>").WithLocation(5, 11),