126 references to ERR_RefLvalueExpected
Microsoft.CodeAnalysis.CSharp (6)
Binder\Binder.ValueChecks.cs (3)
1005if (errorCode is ErrorCode.ERR_InvalidAddrOp or ErrorCode.ERR_IncrementLvalueExpected or ErrorCode.ERR_RefReturnThis or ErrorCode.ERR_RefLocalOrParamExpected or ErrorCode.ERR_RefLvalueExpected) 3236return ErrorCode.ERR_RefLvalueExpected; 3308return ErrorCode.ERR_RefLvalueExpected;
Binder\ForEachLoopBinder.cs (2)
248Error(diagnostics, ErrorCode.ERR_RefLvalueExpected, collectionExpr.Syntax); 254Error(diagnostics, ErrorCode.ERR_RefLvalueExpected, collectionExpr.Syntax);
Errors\ErrorFacts.cs (1)
1209or ErrorCode.ERR_RefLvalueExpected
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (13)
CodeGen\CodeGenAwaitForeachTests.cs (3)
1710Diagnostic(ErrorCode.ERR_RefLvalueExpected, "new C()").WithLocation(6, 37) 7997Diagnostic(ErrorCode.ERR_RefLvalueExpected, "new C()").WithLocation(8, 33)); 8030Diagnostic(ErrorCode.ERR_RefLvalueExpected, "c").WithLocation(9, 33)
CodeGen\CodeGenDeconstructTests.cs (1)
2466Diagnostic(ErrorCode.ERR_RefLvalueExpected, "(x, y) = c").WithLocation(10, 9)
CodeGen\CodeGenForEachTests.cs (2)
4181Diagnostic(ErrorCode.ERR_RefLvalueExpected, "new C()").WithLocation(7, 27)); 4213Diagnostic(ErrorCode.ERR_RefLvalueExpected, "c").WithLocation(8, 27)
CodeGen\CodeGenRefLocalTests.cs (1)
4145Diagnostic(ErrorCode.ERR_RefLvalueExpected, "{1,2,3}"),
CodeGen\CodeGenTupleEqualityTests.cs (2)
5270Diagnostic(ErrorCode.ERR_RefLvalueExpected, "(1, 2) == (3, 4)").WithLocation(8, 15), 5273Diagnostic(ErrorCode.ERR_RefLvalueExpected, "(1, 2) == (3, 4)").WithLocation(8, 37)
CodeGen\UnsafeTests.cs (3)
5177Diagnostic(ErrorCode.ERR_RefLvalueExpected, "new Fixable(1)").WithLocation(6, 25), 10907Diagnostic(ErrorCode.ERR_RefLvalueExpected, "s.i"), 10910Diagnostic(ErrorCode.ERR_RefLvalueExpected, "s.i"));
Emit\CompilationEmitTests.cs (1)
1384Diagnostic(ErrorCode.ERR_RefLvalueExpected, "1").WithLocation(13, 9)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (11)
RefReadonlyParameterTests.cs (2)
2482Diagnostic(ErrorCode.ERR_RefLvalueExpected, "6").WithLocation(6, 15), 2514Diagnostic(ErrorCode.ERR_RefLvalueExpected, "6").WithLocation(10, 15));
Semantics\ExtensionTests.cs (4)
4784Diagnostic(ErrorCode.ERR_RefLvalueExpected, "GetInt()").WithLocation(5, 9), 4787Diagnostic(ErrorCode.ERR_RefLvalueExpected, "GetInt()").WithLocation(6, 9), 4790Diagnostic(ErrorCode.ERR_RefLvalueExpected, "GetInt()").WithLocation(7, 13) 36034Diagnostic(ErrorCode.ERR_RefLvalueExpected, "new C()").WithLocation(7, 27));
Semantics\InlineArrayTests.cs (4)
8983Diagnostic(ErrorCode.ERR_RefLvalueExpected, "M3()[0]").WithLocation(11, 23) 19129Diagnostic(ErrorCode.ERR_RefLvalueExpected, "GetBuffer(x)").WithLocation(11, 40), 19132Diagnostic(ErrorCode.ERR_RefLvalueExpected, "x").WithLocation(20, 40) 19161Diagnostic(ErrorCode.ERR_RefLvalueExpected, "GetBuffer(x)").WithLocation(11, 31)
Semantics\PrimaryConstructorTests.cs (1)
15621Diagnostic(ErrorCode.ERR_RefLvalueExpected, "x").WithLocation(4, 45)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (1)
IOperation\IOperationTests_IVariableDeclaration.cs (1)
3885Diagnostic(ErrorCode.ERR_RefLvalueExpected, "1").WithLocation(7, 21)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (92)
Semantics\ArglistTests.cs (1)
231Diagnostic(ErrorCode.ERR_RefLvalueExpected, "123").WithLocation(9, 40),
Semantics\DelegateTypeTests.cs (2)
10391Diagnostic(ErrorCode.ERR_RefLvalueExpected, "() => { }").WithLocation(6, 22), 10397Diagnostic(ErrorCode.ERR_RefLvalueExpected, "delegate () { }").WithLocation(7, 22));
Semantics\ImplicitObjectCreationTests.cs (2)
2750Diagnostic(ErrorCode.ERR_RefLvalueExpected, "new()").WithLocation(6, 46) 2791Diagnostic(ErrorCode.ERR_RefLvalueExpected, "new()").WithLocation(7, 15)
Semantics\IndexAndRangeTests.cs (3)
655Diagnostic(ErrorCode.ERR_RefLvalueExpected, "arr[0..2]").WithLocation(32, 27), 772Diagnostic(ErrorCode.ERR_RefLvalueExpected, "^0").WithLocation(5, 27), 797Diagnostic(ErrorCode.ERR_RefLvalueExpected, "^0").WithLocation(4, 25));
Semantics\InterpolationTests.cs (11)
6555Diagnostic(ErrorCode.ERR_RefLvalueExpected, expression).WithLocation(2, 7) 10487Diagnostic(ErrorCode.ERR_RefLvalueExpected, "new StructLogger(true, 1)").WithLocation(7, 9) 10837Diagnostic(ErrorCode.ERR_RefLvalueExpected, "new ClassLogger(true, 1)").WithLocation(7, 9) 18360Diagnostic(ErrorCode.ERR_RefLvalueExpected, stringLiteral).WithLocation(6, 19), 18366Diagnostic(ErrorCode.ERR_RefLvalueExpected, stringLiteral).WithLocation(8, 19) 18397Diagnostic(ErrorCode.ERR_RefLvalueExpected, stringLiteral).WithLocation(6, 19), 18403Diagnostic(ErrorCode.ERR_RefLvalueExpected, stringLiteral).WithLocation(8, 19) 18434Diagnostic(ErrorCode.ERR_RefLvalueExpected, stringLiteral).WithLocation(6, 18), 18440Diagnostic(ErrorCode.ERR_RefLvalueExpected, stringLiteral).WithLocation(8, 18) 18471Diagnostic(ErrorCode.ERR_RefLvalueExpected, stringLiteral).WithLocation(6, 19), 18477Diagnostic(ErrorCode.ERR_RefLvalueExpected, stringLiteral).WithLocation(8, 19)
Semantics\MethodTypeInferenceTests.cs (1)
1020Diagnostic(ErrorCode.ERR_RefLvalueExpected, "Main()")
Semantics\NullableReferenceTypesTests.cs (2)
35557Diagnostic(ErrorCode.ERR_RefLvalueExpected, "null").WithLocation(8, 15), 35560Diagnostic(ErrorCode.ERR_RefLvalueExpected, @"""""").WithLocation(9, 15),
Semantics\OverloadResolutionTests.cs (5)
9548Diagnostic(ErrorCode.ERR_RefLvalueExpected, "5").WithLocation(9, 20) 10824Diagnostic(ErrorCode.ERR_RefLvalueExpected, "2").WithLocation(20, 26), 10921Diagnostic(ErrorCode.ERR_RefLvalueExpected, "2").WithLocation(30, 25), 11529Diagnostic(ErrorCode.ERR_RefLvalueExpected, "1").WithLocation(14, 10) 11538Diagnostic(ErrorCode.ERR_RefLvalueExpected, "1").WithLocation(14, 10)
Semantics\RawInterpolationTests_Handler.cs (1)
4803Diagnostic(ErrorCode.ERR_RefLvalueExpected, expression).WithLocation(2, 7));
Semantics\RefEscapingTests.cs (6)
5512Diagnostic(ErrorCode.ERR_RefLvalueExpected, "(global, global) = global").WithLocation(8, 9) 5540Diagnostic(ErrorCode.ERR_RefLvalueExpected, "(global, global) = global").WithLocation(8, 9) 7111Diagnostic(ErrorCode.ERR_RefLvalueExpected, "this").WithLocation(6, 20), 7114Diagnostic(ErrorCode.ERR_RefLvalueExpected, "this").WithLocation(7, 19), 7168Diagnostic(ErrorCode.ERR_RefLvalueExpected, "this").WithLocation(7, 19), 7224Diagnostic(ErrorCode.ERR_RefLvalueExpected, "this").WithLocation(7, 19),
Semantics\RefExtensionMethodsTests.cs (1)
42Diagnostic(ErrorCode.ERR_RefLvalueExpected, "5").WithLocation(13, 9));
Semantics\RefFieldTests.cs (3)
701Diagnostic(ErrorCode.ERR_RefLvalueExpected, "default").WithLocation(6, 25), 20869Diagnostic(ErrorCode.ERR_RefLvalueExpected, "Value()").WithLocation(8, 39) 29289Diagnostic(ErrorCode.ERR_RefLvalueExpected, "1").WithLocation(4, 19),
Semantics\RefLocalsAndReturnsTests.cs (18)
382Diagnostic(ErrorCode.ERR_RefLvalueExpected, "rro = ref _ro").WithLocation(12, 20), 385Diagnostic(ErrorCode.ERR_RefLvalueExpected, "rro = ref rrw").WithLocation(13, 20), 388Diagnostic(ErrorCode.ERR_RefLvalueExpected, "rro = ref _rw").WithLocation(16, 28), 391Diagnostic(ErrorCode.ERR_RefLvalueExpected, @"true 500Diagnostic(ErrorCode.ERR_RefLvalueExpected, "new int[0]").WithLocation(7, 31), 503Diagnostic(ErrorCode.ERR_RefLvalueExpected, "new int[0]").WithLocation(10, 40), 530Diagnostic(ErrorCode.ERR_RefLvalueExpected, "(string)o").WithLocation(11, 18), 632Diagnostic(ErrorCode.ERR_RefLvalueExpected, "s2").WithLocation(8, 17)); 985Diagnostic(ErrorCode.ERR_RefLvalueExpected, "rrx").WithLocation(9, 18)); 1428Diagnostic(ErrorCode.ERR_RefLvalueExpected, "new int[1]").WithLocation(10, 49)); 1556Diagnostic(ErrorCode.ERR_RefLvalueExpected, "xr").WithLocation(14, 26), 1559Diagnostic(ErrorCode.ERR_RefLvalueExpected, "xr").WithLocation(15, 19)); 1587Diagnostic(ErrorCode.ERR_RefLvalueExpected, "42").WithLocation(8, 15), 1593Diagnostic(ErrorCode.ERR_RefLvalueExpected, "xr").WithLocation(12, 15), 1627Diagnostic(ErrorCode.ERR_RefLvalueExpected, "x").WithLocation(10, 21), 1630Diagnostic(ErrorCode.ERR_RefLvalueExpected, "x").WithLocation(11, 25) 3673Diagnostic(ErrorCode.ERR_RefLvalueExpected, "L()").WithLocation(11, 26) 3695Diagnostic(ErrorCode.ERR_RefLvalueExpected, "d()").WithLocation(8, 26)
Semantics\SemanticAnalyzerTests.cs (4)
807Diagnostic(ErrorCode.ERR_RefLvalueExpected, "123").WithLocation(27, 24), 810Diagnostic(ErrorCode.ERR_RefLvalueExpected, "x").WithLocation(28, 24), 813Diagnostic(ErrorCode.ERR_RefLvalueExpected, "y + y").WithLocation(33, 24), 816Diagnostic(ErrorCode.ERR_RefLvalueExpected, "null").WithLocation(35, 24),
Semantics\SemanticErrorTests.cs (23)
14143new ErrorDescription { Code = (int)ErrorCode.ERR_RefLvalueExpected, Line = 5, Column = 15 }); 14163Diagnostic(ErrorCode.ERR_RefLvalueExpected, "x => x = 1").WithLocation(5, 44), 14166Diagnostic(ErrorCode.ERR_RefLvalueExpected, "(x,y) => x = 1").WithLocation(6, 49), 14169Diagnostic(ErrorCode.ERR_RefLvalueExpected, "delegate (int x) {x = 1;}").WithLocation(7, 44)); 14189Diagnostic(ErrorCode.ERR_RefLvalueExpected, "x => x = 1").WithLocation(5, 44), 14192Diagnostic(ErrorCode.ERR_RefLvalueExpected, "(x,y) => x = 1").WithLocation(6, 49), 14195Diagnostic(ErrorCode.ERR_RefLvalueExpected, "delegate (int x) {x = 1;}").WithLocation(7, 44)); 14217Diagnostic(ErrorCode.ERR_RefLvalueExpected, "x => x = 1").WithLocation(7, 22), 14220Diagnostic(ErrorCode.ERR_RefLvalueExpected, "(x,y) => x = 1").WithLocation(8, 27), 14223Diagnostic(ErrorCode.ERR_RefLvalueExpected, "delegate (int x) {x = 1;}").WithLocation(9, 22)); 14245Diagnostic(ErrorCode.ERR_RefLvalueExpected, "x => x = 1").WithLocation(7, 22), 14248Diagnostic(ErrorCode.ERR_RefLvalueExpected, "(x,y) => x = 1").WithLocation(8, 27), 14251Diagnostic(ErrorCode.ERR_RefLvalueExpected, "delegate (int x) {x = 1;}").WithLocation(9, 22)); 23126Diagnostic(ErrorCode.ERR_RefLvalueExpected, "x => x").WithLocation(16, 47), 23129Diagnostic(ErrorCode.ERR_RefLvalueExpected, "Goo<string>(x => x)").WithLocation(17, 47), 23135Diagnostic(ErrorCode.ERR_RefLvalueExpected, "new Func<string, string>(x => x)").WithLocation(19, 47), 23141Diagnostic(ErrorCode.ERR_RefLvalueExpected, "Program.Goo<string>(x => x)").WithLocation(21, 47), 23144Diagnostic(ErrorCode.ERR_RefLvalueExpected, "new(x => x)").WithLocation(23, 48) 23159Diagnostic(ErrorCode.ERR_RefLvalueExpected, "x => x").WithLocation(16, 47), 23162Diagnostic(ErrorCode.ERR_RefLvalueExpected, "Goo<string>(x => x)").WithLocation(17, 47), 23168Diagnostic(ErrorCode.ERR_RefLvalueExpected, "new Func<string, string>(x => x)").WithLocation(19, 47), 23174Diagnostic(ErrorCode.ERR_RefLvalueExpected, "Program.Goo<string>(x => x)").WithLocation(21, 47), 23180Diagnostic(ErrorCode.ERR_RefLvalueExpected, "new(x => x)").WithLocation(23, 48)
Semantics\StackAllocInitializerTests.cs (6)
1654Diagnostic(ErrorCode.ERR_RefLvalueExpected, "stackalloc int [3] { 1, 2, 3 }").WithLocation(7, 28), 1660Diagnostic(ErrorCode.ERR_RefLvalueExpected, "stackalloc int [ ] { 1, 2, 3 }").WithLocation(8, 28), 1666Diagnostic(ErrorCode.ERR_RefLvalueExpected, "stackalloc [ ] { 1, 2, 3 }").WithLocation(9, 28) 1688Diagnostic(ErrorCode.ERR_RefLvalueExpected, "stackalloc int [3] { 1, 2, 3 }").WithLocation(7, 32), 1691Diagnostic(ErrorCode.ERR_RefLvalueExpected, "stackalloc int [ ] { 1, 2, 3 }").WithLocation(8, 32), 1694Diagnostic(ErrorCode.ERR_RefLvalueExpected, "stackalloc [ ] { 1, 2, 3 }").WithLocation(9, 32)
Semantics\StackAllocSpanExpressionsTests.cs (2)
496Diagnostic(ErrorCode.ERR_RefLvalueExpected, "stackalloc int[1]").WithLocation(7, 27)); 520Diagnostic(ErrorCode.ERR_RefLvalueExpected, "stackalloc int[1]").WithLocation(7, 31)
Semantics\TargetTypedDefaultTests.cs (1)
1211Diagnostic(ErrorCode.ERR_RefLvalueExpected, "default").WithLocation(18, 46)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Symbols\FunctionPointerTypeSymbolTests.cs (1)
1221Diagnostic(ErrorCode.ERR_RefLvalueExpected, "p3()").WithLocation(14, 30),
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
Parsing\AnonymousFunctionParsingTests.cs (2)
957Diagnostic(ErrorCode.ERR_RefLvalueExpected, "static x => x").WithLocation(1, 29)); 967Diagnostic(ErrorCode.ERR_RefLvalueExpected, "static x => x").WithLocation(1, 29));