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