32 references to ERR_AnonDelegateCantUse
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder_Expressions.cs (1)
1934
Error(diagnostics, parameter.Type.IsRefLikeType ? ErrorCode.ERR_AnonDelegateCantUseRefLike : ErrorCode.
ERR_AnonDelegateCantUse
, node, parameter.Name);
Errors\ErrorFacts.cs (1)
1227
case ErrorCode.
ERR_AnonDelegateCantUse
:
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
FlowAnalysis\FlowDiagnosticTests.cs (1)
2532
Diagnostic(ErrorCode.
ERR_AnonDelegateCantUse
, "p1").WithArguments("p1"),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (29)
Semantics\LocalFunctionTests.cs (2)
3374
Diagnostic(ErrorCode.
ERR_AnonDelegateCantUse
, "x").WithArguments("x").WithLocation(10, 31)
3401
Diagnostic(ErrorCode.
ERR_AnonDelegateCantUse
, "x").WithArguments("x").WithLocation(10, 31)
Semantics\NameOfTests.cs (1)
1239
Diagnostic(ErrorCode.
ERR_AnonDelegateCantUse
, "x").WithArguments("x").WithLocation(20, 56),
Semantics\NullableReferenceTypesTests.cs (1)
79550
Diagnostic(ErrorCode.
ERR_AnonDelegateCantUse
, "i").WithArguments("i").WithLocation(6, 37));
Semantics\PrimaryConstructorTests.cs (23)
15155
("0002", BadReference, "(ref int p1) { void M1() { local(); void local() { p1 = 1; } } }", ErrorCode.
ERR_AnonDelegateCantUse
),
15156
("0003", BadReference, "(ref int p1) { void M1() { local1(); void local1() { local2(); void local2() { p1 = 1; } } } }", ErrorCode.
ERR_AnonDelegateCantUse
),
15158
("0005", BadReference, "(in int p1) { void M1() { local(); void local() { p1.ToString(); } } }", ErrorCode.
ERR_AnonDelegateCantUse
),
15159
("0006", BadReference, "(in int p1) { void M1() { local1(); void local1() { local2(); void local2() { p1.ToString(); } } } }", ErrorCode.
ERR_AnonDelegateCantUse
),
15161
("0008", BadReference, "(out int p1) { int x = p1 = 0; void M1() { local(); void local() { p1 = 1; } } }", ErrorCode.
ERR_AnonDelegateCantUse
),
15162
("0009", BadReference, "(out int p1) { int x = p1 = 0; void M1() { local1(); void local1() { local2(); void local2() { p1 = 1; } } } }", ErrorCode.
ERR_AnonDelegateCantUse
),
15166
("0013", BadReference, "(ref int p1) { void M1() { _ = (System.Action)(() => { p1 = 1; }); } }", ErrorCode.
ERR_AnonDelegateCantUse
),
15167
("0014", BadReference, "(in int p1) { void M1() { _ = (System.Action)(() => { p1.ToString(); }); } }", ErrorCode.
ERR_AnonDelegateCantUse
),
15168
("0015", BadReference, "(out int p1) { int x = p1 = 0; void M1() { _ = (System.Action)(() => { p1 = 1; }); } }", ErrorCode.
ERR_AnonDelegateCantUse
),
15184
("0201", BadReference, "(ref int p1) { System.Action F = () => p1 = 0; }", ErrorCode.
ERR_AnonDelegateCantUse
),
15185
("0202", BadReference, "(ref int p1) { System.Action P { get; } = () => p1 = 0; }", ErrorCode.
ERR_AnonDelegateCantUse
),
15186
("0203", BadReference, "(ref int p1) { public event System.Action E = () => p1 = 0; }", ErrorCode.
ERR_AnonDelegateCantUse
),
15187
("0204", BadReference, "(in int p1) { System.Action F = () => p1.ToString(); }", ErrorCode.
ERR_AnonDelegateCantUse
),
15188
("0205", BadReference, "(in int p1) { System.Action P { get; } = () => p1.ToString(); }", ErrorCode.
ERR_AnonDelegateCantUse
),
15189
("0206", BadReference, "(in int p1) { public event System.Action E = () => p1.ToString(); }", ErrorCode.
ERR_AnonDelegateCantUse
),
15190
("0207", BadReference, "(out int p1) { System.Action F = (p1 = 0) == 0 ? () => p1 = 0 : null; }", ErrorCode.
ERR_AnonDelegateCantUse
),
15191
("0208", BadReference, "(out int p1) { System.Action P { get; } = (p1 = 0) == 0 ? () => p1 = 0 : null; }", ErrorCode.
ERR_AnonDelegateCantUse
),
15192
("0209", BadReference, "(out int p1) { public event System.Action E = (p1 = 0) == 0 ? () => p1 = 0 : null; }", ErrorCode.
ERR_AnonDelegateCantUse
),
15213
("1001", BadReference, "(ref int p1) : Base(() => p1 = 0); class Base { public Base(System.Action x) {} }", ErrorCode.
ERR_AnonDelegateCantUse
),
15214
("1002", BadReference, "(in int p1) : Base(() => p1.ToString()); class Base { public Base(System.Action x) {} }", ErrorCode.
ERR_AnonDelegateCantUse
),
15215
("1003", BadReference, "(out int p1) : Base(p1 = 0, () => p1 = 0); class Base { public Base(int y, System.Action x) {} }", ErrorCode.
ERR_AnonDelegateCantUse
),
15259
case ErrorCode.
ERR_AnonDelegateCantUse
:
15263
Diagnostic(ErrorCode.
ERR_AnonDelegateCantUse
, "p1").WithArguments("p1").WithLocation(2000, 1)
Semantics\SemanticErrorTests.cs (1)
15259
new ErrorDescription[] { new ErrorDescription { Code = (int)ErrorCode.
ERR_AnonDelegateCantUse
, Line = 8, Column = 42 } });
Semantics\UnsafeTests.cs (1)
4352
Diagnostic(ErrorCode.
ERR_AnonDelegateCantUse
, "x").WithArguments("x"));