32 references to ERR_AnonDelegateCantUse
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder_Expressions.cs (1)
2107
Error(diagnostics, ErrorCode.
ERR_AnonDelegateCantUse
, node, parameter.Name);
Errors\ErrorFacts.cs (1)
1291
or ErrorCode.
ERR_AnonDelegateCantUse
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (24)
FlowAnalysis\FlowDiagnosticTests.cs (1)
2550
Diagnostic(ErrorCode.
ERR_AnonDelegateCantUse
, "p1").WithArguments("p1"),
Semantics\PrimaryConstructorTests.cs (23)
20155
("0002", BadReference, "(ref int p1) { void M1() { local(); void local() { p1 = 1; } } }", ErrorCode.
ERR_AnonDelegateCantUse
),
20156
("0003", BadReference, "(ref int p1) { void M1() { local1(); void local1() { local2(); void local2() { p1 = 1; } } } }", ErrorCode.
ERR_AnonDelegateCantUse
),
20158
("0005", BadReference, "(in int p1) { void M1() { local(); void local() { p1.ToString(); } } }", ErrorCode.
ERR_AnonDelegateCantUse
),
20159
("0006", BadReference, "(in int p1) { void M1() { local1(); void local1() { local2(); void local2() { p1.ToString(); } } } }", ErrorCode.
ERR_AnonDelegateCantUse
),
20161
("0008", BadReference, "(out int p1) { int x = p1 = 0; void M1() { local(); void local() { p1 = 1; } } }", ErrorCode.
ERR_AnonDelegateCantUse
),
20162
("0009", BadReference, "(out int p1) { int x = p1 = 0; void M1() { local1(); void local1() { local2(); void local2() { p1 = 1; } } } }", ErrorCode.
ERR_AnonDelegateCantUse
),
20166
("0013", BadReference, "(ref int p1) { void M1() { _ = (System.Action)(() => { p1 = 1; }); } }", ErrorCode.
ERR_AnonDelegateCantUse
),
20167
("0014", BadReference, "(in int p1) { void M1() { _ = (System.Action)(() => { p1.ToString(); }); } }", ErrorCode.
ERR_AnonDelegateCantUse
),
20168
("0015", BadReference, "(out int p1) { int x = p1 = 0; void M1() { _ = (System.Action)(() => { p1 = 1; }); } }", ErrorCode.
ERR_AnonDelegateCantUse
),
20184
("0201", BadReference, "(ref int p1) { System.Action F = () => p1 = 0; }", ErrorCode.
ERR_AnonDelegateCantUse
),
20185
("0202", BadReference, "(ref int p1) { System.Action P { get; } = () => p1 = 0; }", ErrorCode.
ERR_AnonDelegateCantUse
),
20186
("0203", BadReference, "(ref int p1) { public event System.Action E = () => p1 = 0; }", ErrorCode.
ERR_AnonDelegateCantUse
),
20187
("0204", BadReference, "(in int p1) { System.Action F = () => p1.ToString(); }", ErrorCode.
ERR_AnonDelegateCantUse
),
20188
("0205", BadReference, "(in int p1) { System.Action P { get; } = () => p1.ToString(); }", ErrorCode.
ERR_AnonDelegateCantUse
),
20189
("0206", BadReference, "(in int p1) { public event System.Action E = () => p1.ToString(); }", ErrorCode.
ERR_AnonDelegateCantUse
),
20190
("0207", BadReference, "(out int p1) { System.Action F = (p1 = 0) == 0 ? () => p1 = 0 : null; }", ErrorCode.
ERR_AnonDelegateCantUse
),
20191
("0208", BadReference, "(out int p1) { System.Action P { get; } = (p1 = 0) == 0 ? () => p1 = 0 : null; }", ErrorCode.
ERR_AnonDelegateCantUse
),
20192
("0209", BadReference, "(out int p1) { public event System.Action E = (p1 = 0) == 0 ? () => p1 = 0 : null; }", ErrorCode.
ERR_AnonDelegateCantUse
),
20213
("1001", BadReference, "(ref int p1) : Base(() => p1 = 0); class Base { public Base(System.Action x) {} }", ErrorCode.
ERR_AnonDelegateCantUse
),
20214
("1002", BadReference, "(in int p1) : Base(() => p1.ToString()); class Base { public Base(System.Action x) {} }", ErrorCode.
ERR_AnonDelegateCantUse
),
20215
("1003", BadReference, "(out int p1) : Base(p1 = 0, () => p1 = 0); class Base { public Base(int y, System.Action x) {} }", ErrorCode.
ERR_AnonDelegateCantUse
),
20259
case ErrorCode.
ERR_AnonDelegateCantUse
:
20263
Diagnostic(ErrorCode.
ERR_AnonDelegateCantUse
, "p1").WithArguments("p1").WithLocation(2000, 1)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (6)
Semantics\LocalFunctionTests.cs (2)
3763
Diagnostic(ErrorCode.
ERR_AnonDelegateCantUse
, "x").WithArguments("x").WithLocation(10, 31)
3790
Diagnostic(ErrorCode.
ERR_AnonDelegateCantUse
, "x").WithArguments("x").WithLocation(10, 31)
Semantics\NameOfTests.cs (1)
1544
Diagnostic(ErrorCode.
ERR_AnonDelegateCantUse
, "x").WithArguments("x").WithLocation(20, 56),
Semantics\NullableReferenceTypesTests.cs (1)
83298
Diagnostic(ErrorCode.
ERR_AnonDelegateCantUse
, "i").WithArguments("i").WithLocation(6, 37));
Semantics\SemanticErrorTests.cs (1)
15419
new ErrorDescription[] { new ErrorDescription { Code = (int)ErrorCode.
ERR_AnonDelegateCantUse
, Line = 8, Column = 42 } });
Semantics\UnsafeTests.cs (1)
7190
Diagnostic(ErrorCode.
ERR_AnonDelegateCantUse
, "x").WithArguments("x"));