143 references to ERR_RefLvalueExpected
Microsoft.CodeAnalysis.CSharp (6)
Binder\Binder.ValueChecks.cs (3)
1228if (errorCode is ErrorCode.ERR_InvalidAddrOp or ErrorCode.ERR_IncrementLvalueExpected or ErrorCode.ERR_RefReturnThis or ErrorCode.ERR_RefLocalOrParamExpected or ErrorCode.ERR_RefLvalueExpected) 3479return ErrorCode.ERR_RefLvalueExpected; 3551return 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)
2517Diagnostic(ErrorCode.ERR_RefLvalueExpected, "new C()").WithLocation(6, 37) 12658Diagnostic(ErrorCode.ERR_RefLvalueExpected, "new C()").WithLocation(8, 33)); 12691Diagnostic(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)
4154Diagnostic(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)
5453Diagnostic(ErrorCode.ERR_RefLvalueExpected, "new Fixable(1)").WithLocation(6, 25), 11183Diagnostic(ErrorCode.ERR_RefLvalueExpected, "s.i"), 11186Diagnostic(ErrorCode.ERR_RefLvalueExpected, "s.i"));
Emit\CompilationEmitTests.cs (1)
1384Diagnostic(ErrorCode.ERR_RefLvalueExpected, "1").WithLocation(13, 9)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (28)
RefReadonlyParameterTests.cs (2)
2482Diagnostic(ErrorCode.ERR_RefLvalueExpected, "6").WithLocation(6, 15), 2514Diagnostic(ErrorCode.ERR_RefLvalueExpected, "6").WithLocation(10, 15));
Semantics\ExtensionTests.cs (7)
5145Diagnostic(ErrorCode.ERR_RefLvalueExpected, "GetInt()").WithLocation(5, 9), 5148Diagnostic(ErrorCode.ERR_RefLvalueExpected, "GetInt()").WithLocation(6, 9), 5151Diagnostic(ErrorCode.ERR_RefLvalueExpected, "GetInt()").WithLocation(7, 13) 22258Diagnostic(ErrorCode.ERR_RefLvalueExpected, "1").WithLocation(1, 1), 41578Diagnostic(ErrorCode.ERR_RefLvalueExpected, "new C()").WithLocation(7, 27)); 45291Diagnostic(ErrorCode.ERR_RefLvalueExpected, "(int x1, int x2) = i").WithLocation(2, 1)); 45307Diagnostic(ErrorCode.ERR_RefLvalueExpected, "(int x1, int x2) = i").WithLocation(2, 1));
Semantics\ExtensionTests2.cs (14)
7453Diagnostic(ErrorCode.ERR_RefLvalueExpected, "default(S1)").WithLocation(15, 9) 7880Diagnostic(ErrorCode.ERR_RefLvalueExpected, "default(T)").WithLocation(13, 9), 8840Diagnostic(ErrorCode.ERR_RefLvalueExpected, "default(S1)").WithLocation(15, 9) 9317Diagnostic(ErrorCode.ERR_RefLvalueExpected, "default(T)").WithLocation(13, 9), 10181Diagnostic(ErrorCode.ERR_RefLvalueExpected, "default(S1)").WithLocation(15, 11) 10532Diagnostic(ErrorCode.ERR_RefLvalueExpected, "default(T)").WithLocation(13, 11), 10920Diagnostic(ErrorCode.ERR_RefLvalueExpected, "default(S1)").WithLocation(15, 9) 11271Diagnostic(ErrorCode.ERR_RefLvalueExpected, "default(T)").WithLocation(13, 9), 11887Diagnostic(ErrorCode.ERR_RefLvalueExpected, "default(S1)").WithLocation(16, 9), 11890Diagnostic(ErrorCode.ERR_RefLvalueExpected, "default(S1)").WithLocation(20, 9) 12762Diagnostic(ErrorCode.ERR_RefLvalueExpected, "default(T)").WithLocation(14, 9), 12765Diagnostic(ErrorCode.ERR_RefLvalueExpected, "default(T)").WithLocation(18, 9), 13417Diagnostic(ErrorCode.ERR_RefLvalueExpected, "default(S1)").WithLocation(15, 10) 13865Diagnostic(ErrorCode.ERR_RefLvalueExpected, "default(T)").WithLocation(13, 10),
Semantics\InlineArrayTests.cs (4)
8989Diagnostic(ErrorCode.ERR_RefLvalueExpected, "M3()[0]").WithLocation(11, 23) 19135Diagnostic(ErrorCode.ERR_RefLvalueExpected, "GetBuffer(x)").WithLocation(11, 40), 19138Diagnostic(ErrorCode.ERR_RefLvalueExpected, "x").WithLocation(20, 40) 19167Diagnostic(ErrorCode.ERR_RefLvalueExpected, "GetBuffer(x)").WithLocation(11, 31)
Semantics\PrimaryConstructorTests.cs (1)
15631Diagnostic(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)
10365Diagnostic(ErrorCode.ERR_RefLvalueExpected, "() => { }").WithLocation(6, 22), 10371Diagnostic(ErrorCode.ERR_RefLvalueExpected, "delegate () { }").WithLocation(7, 22));
Semantics\ImplicitObjectCreationTests.cs (2)
2746Diagnostic(ErrorCode.ERR_RefLvalueExpected, "new()").WithLocation(6, 46) 2787Diagnostic(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)
6556Diagnostic(ErrorCode.ERR_RefLvalueExpected, expression).WithLocation(2, 7) 10620Diagnostic(ErrorCode.ERR_RefLvalueExpected, "new StructLogger(true, 1)").WithLocation(7, 9) 10970Diagnostic(ErrorCode.ERR_RefLvalueExpected, "new ClassLogger(true, 1)").WithLocation(7, 9) 18762Diagnostic(ErrorCode.ERR_RefLvalueExpected, stringLiteral).WithLocation(6, 19), 18768Diagnostic(ErrorCode.ERR_RefLvalueExpected, stringLiteral).WithLocation(8, 19) 18799Diagnostic(ErrorCode.ERR_RefLvalueExpected, stringLiteral).WithLocation(6, 19), 18805Diagnostic(ErrorCode.ERR_RefLvalueExpected, stringLiteral).WithLocation(8, 19) 18836Diagnostic(ErrorCode.ERR_RefLvalueExpected, stringLiteral).WithLocation(6, 18), 18842Diagnostic(ErrorCode.ERR_RefLvalueExpected, stringLiteral).WithLocation(8, 18) 18873Diagnostic(ErrorCode.ERR_RefLvalueExpected, stringLiteral).WithLocation(6, 19), 18879Diagnostic(ErrorCode.ERR_RefLvalueExpected, stringLiteral).WithLocation(8, 19)
Semantics\MethodTypeInferenceTests.cs (1)
1020Diagnostic(ErrorCode.ERR_RefLvalueExpected, "Main()")
Semantics\NullableReferenceTypesTests.cs (2)
35558Diagnostic(ErrorCode.ERR_RefLvalueExpected, "null").WithLocation(8, 15), 35561Diagnostic(ErrorCode.ERR_RefLvalueExpected, @"""""").WithLocation(9, 15),
Semantics\OverloadResolutionTests.cs (5)
9545Diagnostic(ErrorCode.ERR_RefLvalueExpected, "5").WithLocation(9, 20) 10821Diagnostic(ErrorCode.ERR_RefLvalueExpected, "2").WithLocation(20, 26), 10918Diagnostic(ErrorCode.ERR_RefLvalueExpected, "2").WithLocation(30, 25), 11526Diagnostic(ErrorCode.ERR_RefLvalueExpected, "1").WithLocation(14, 10) 11535Diagnostic(ErrorCode.ERR_RefLvalueExpected, "1").WithLocation(14, 10)
Semantics\RawInterpolationTests_Handler.cs (1)
4804Diagnostic(ErrorCode.ERR_RefLvalueExpected, expression).WithLocation(2, 7));
Semantics\RefEscapingTests.cs (6)
6093Diagnostic(ErrorCode.ERR_RefLvalueExpected, "(global, global) = global").WithLocation(8, 9) 6121Diagnostic(ErrorCode.ERR_RefLvalueExpected, "(global, global) = global").WithLocation(8, 9) 7692Diagnostic(ErrorCode.ERR_RefLvalueExpected, "this").WithLocation(6, 20), 7695Diagnostic(ErrorCode.ERR_RefLvalueExpected, "this").WithLocation(7, 19), 7749Diagnostic(ErrorCode.ERR_RefLvalueExpected, "this").WithLocation(7, 19), 7805Diagnostic(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)
14188new ErrorDescription { Code = (int)ErrorCode.ERR_RefLvalueExpected, Line = 5, Column = 15 }); 14208Diagnostic(ErrorCode.ERR_RefLvalueExpected, "x => x = 1").WithLocation(5, 44), 14211Diagnostic(ErrorCode.ERR_RefLvalueExpected, "(x,y) => x = 1").WithLocation(6, 49), 14214Diagnostic(ErrorCode.ERR_RefLvalueExpected, "delegate (int x) {x = 1;}").WithLocation(7, 44)); 14234Diagnostic(ErrorCode.ERR_RefLvalueExpected, "x => x = 1").WithLocation(5, 44), 14237Diagnostic(ErrorCode.ERR_RefLvalueExpected, "(x,y) => x = 1").WithLocation(6, 49), 14240Diagnostic(ErrorCode.ERR_RefLvalueExpected, "delegate (int x) {x = 1;}").WithLocation(7, 44)); 14262Diagnostic(ErrorCode.ERR_RefLvalueExpected, "x => x = 1").WithLocation(7, 22), 14265Diagnostic(ErrorCode.ERR_RefLvalueExpected, "(x,y) => x = 1").WithLocation(8, 27), 14268Diagnostic(ErrorCode.ERR_RefLvalueExpected, "delegate (int x) {x = 1;}").WithLocation(9, 22)); 14290Diagnostic(ErrorCode.ERR_RefLvalueExpected, "x => x = 1").WithLocation(7, 22), 14293Diagnostic(ErrorCode.ERR_RefLvalueExpected, "(x,y) => x = 1").WithLocation(8, 27), 14296Diagnostic(ErrorCode.ERR_RefLvalueExpected, "delegate (int x) {x = 1;}").WithLocation(9, 22)); 23171Diagnostic(ErrorCode.ERR_RefLvalueExpected, "x => x").WithLocation(16, 47), 23174Diagnostic(ErrorCode.ERR_RefLvalueExpected, "Goo<string>(x => x)").WithLocation(17, 47), 23180Diagnostic(ErrorCode.ERR_RefLvalueExpected, "new Func<string, string>(x => x)").WithLocation(19, 47), 23186Diagnostic(ErrorCode.ERR_RefLvalueExpected, "Program.Goo<string>(x => x)").WithLocation(21, 47), 23189Diagnostic(ErrorCode.ERR_RefLvalueExpected, "new(x => x)").WithLocation(23, 48) 23204Diagnostic(ErrorCode.ERR_RefLvalueExpected, "x => x").WithLocation(16, 47), 23207Diagnostic(ErrorCode.ERR_RefLvalueExpected, "Goo<string>(x => x)").WithLocation(17, 47), 23213Diagnostic(ErrorCode.ERR_RefLvalueExpected, "new Func<string, string>(x => x)").WithLocation(19, 47), 23219Diagnostic(ErrorCode.ERR_RefLvalueExpected, "Program.Goo<string>(x => x)").WithLocation(21, 47), 23225Diagnostic(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)
948Diagnostic(ErrorCode.ERR_RefLvalueExpected, "static x => x").WithLocation(1, 29)); 958Diagnostic(ErrorCode.ERR_RefLvalueExpected, "static x => x").WithLocation(1, 29));