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