13 references to ERR_AnonDelegateCantUseRefLike
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder_Expressions.cs (1)
2157
Error(diagnostics, ErrorCode.
ERR_AnonDelegateCantUseRefLike
, node, parameter.Name);
Errors\ErrorFacts.cs (1)
1290
or ErrorCode.
ERR_AnonDelegateCantUseRefLike
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (11)
RefStructInterfacesTests.cs (2)
26150
Diagnostic(ErrorCode.
ERR_AnonDelegateCantUseRefLike
, "r1").WithArguments("r1").WithLocation(11, 24),
26153
Diagnostic(ErrorCode.
ERR_AnonDelegateCantUseRefLike
, "t").WithArguments("t").WithLocation(12, 24)
Semantics\PrimaryConstructorTests.cs (9)
20024
("0011", BadReference, "(S1 p1) { void M1() { local(); void local() { p1.M(); } } } ref struct S1{ public void M(){} }", ErrorCode.
ERR_AnonDelegateCantUseRefLike
),
20025
("0012", BadReference, "(S1 p1) { void M1() { local1(); void local1() { local2(); void local2() { p1.M(); } } } } ref struct S1{ public void M(){} }", ErrorCode.
ERR_AnonDelegateCantUseRefLike
),
20029
("0016", BadReference, "(S1 p1) { void M1() { _ = (System.Action)(() => { p1.M(); }); } } ref struct S1{ public void M(){} }", ErrorCode.
ERR_AnonDelegateCantUseRefLike
),
20053
("0210", BadReference, "(S1 p1) { System.Action F = () => p1.ToString(); } ref struct S1{ public void M(){} }", ErrorCode.
ERR_AnonDelegateCantUseRefLike
),
20054
("0211", BadReference, "(S1 p1) { System.Action P { get; } = () => p1.ToString(); } ref struct S1{ public void M(){} }", ErrorCode.
ERR_AnonDelegateCantUseRefLike
),
20055
("0212", BadReference, "(S1 p1) { public event System.Action E = () => p1.ToString(); } ref struct S1{ public void M(){} }", ErrorCode.
ERR_AnonDelegateCantUseRefLike
),
20076
("1004", BadReference, "(S1 p1) : Base(() => p1.ToString()); ref struct S1{ public void M(){} } class Base { public Base(System.Action x) {} }", ErrorCode.
ERR_AnonDelegateCantUseRefLike
),
20127
case ErrorCode.
ERR_AnonDelegateCantUseRefLike
:
20131
Diagnostic(ErrorCode.
ERR_AnonDelegateCantUseRefLike
, "p1").WithArguments("p1").WithLocation(2000, 1)