34 references to ERR_LockNeedsReference
Microsoft.CodeAnalysis.CSharp (3)
Binder\LockBinder.cs (2)
48
Error(diagnostics, ErrorCode.
ERR_LockNeedsReference
, exprSyntax, expr.Display);
54
Error(diagnostics, ErrorCode.
ERR_LockNeedsReference
, exprSyntax, exprType);
Errors\ErrorFacts.cs (1)
707
case ErrorCode.
ERR_LockNeedsReference
:
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (6)
BreakingChanges.cs (6)
418
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "default(int)").WithArguments("int").WithLocation(9, 15),
421
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "default(TStruct)").WithArguments("TStruct").WithLocation(12, 15)
432
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "default(int)").WithArguments("int").WithLocation(9, 15),
435
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "default(T)").WithArguments("T").WithLocation(10, 15),
438
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "default(TStruct)").WithArguments("TStruct").WithLocation(12, 15),
441
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "null").WithArguments("<null>").WithLocation(13, 15)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (3)
IOperation\IOperationTests_ILockStatement.cs (3)
128
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "i").WithArguments("int").WithLocation(7, 25)
332
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "M2()").WithArguments("void").WithLocation(6, 25)
732
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "input1").WithArguments("int").WithLocation(6, 15)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (22)
Semantics\LockTests.cs (13)
78
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "Main").WithArguments("method group"));
98
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "x => x").WithArguments("lambda expression"));
222
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "x").WithArguments("int"),
243
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "this").WithArguments("Conv"));
264
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "a").WithArguments("int?"));
292
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "PM").WithArguments("method group"),
295
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "PM(1)").WithArguments("void"));
355
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "(ref int y) => { y = y + 1; return y; }").WithArguments("lambda expression"),
358
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "() => { }").WithArguments("lambda expression"));
779
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "monitor2").WithArguments("T").WithLocation(16, 15)
784
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "monitor2").WithArguments("T").WithLocation(16, 15),
787
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "monitor1").WithArguments("T").WithLocation(6, 15),
790
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "null").WithArguments("<null>").WithLocation(9, 15)
Semantics\NullableReferenceTypesTests.cs (1)
1079
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "annotatedMissing").WithArguments("Missing?").WithLocation(8, 15),
Semantics\RefEscapingTests.cs (1)
166
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "s").WithArguments("System.Span<int>").WithLocation(9, 15));
Semantics\SemanticErrorTests.cs (1)
6914
new ErrorDescription[] { new ErrorDescription { Code = (int)ErrorCode.
ERR_LockNeedsReference
, Line = 6, Column = 15 } });
Semantics\StackAllocInitializerTests.cs (6)
604
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "stackalloc int[3] { 1, 2, 3 }").WithArguments("int*").WithLocation(6, 15),
610
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "stackalloc int[ ] { 1, 2, 3 }").WithArguments("int*").WithLocation(7, 15),
616
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "stackalloc [ ] { 1, 2, 3 }").WithArguments("int*").WithLocation(8, 15)
622
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "stackalloc int[3] { 1, 2, 3 }").WithArguments("System.Span<int>").WithLocation(6, 15),
625
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "stackalloc int[ ] { 1, 2, 3 }").WithArguments("System.Span<int>").WithLocation(7, 15),
628
Diagnostic(ErrorCode.
ERR_LockNeedsReference
, "stackalloc [ ] { 1, 2, 3 }").WithArguments("System.Span<int>").WithLocation(8, 15)