163 references to ERR_RefReturnLvalueExpected
Microsoft.CodeAnalysis.CSharp (4)
Binder\Binder.ValueChecks.cs (2)
3300return ErrorCode.ERR_RefReturnLvalueExpected; 3321return ErrorCode.ERR_RefReturnLvalueExpected;
Binder\Binder_Expressions.cs (1)
9533Error(diagnostics, ErrorCode.ERR_RefReturnLvalueExpected, location);
Errors\ErrorFacts.cs (1)
1780or ErrorCode.ERR_RefReturnLvalueExpected
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (13)
CodeGen\CodeGenFunctionPointersTests.cs (1)
10964Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "ptr(ref i)").WithLocation(8, 16)
CodeGen\CodeGenNullCoalescingAssignmentTests.cs (1)
1360Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, @"o ??= ""Test String""").WithLocation(7, 15)
CodeGen\CodeGenRefConditionalOperatorTests.cs (3)
637Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "42").WithLocation(8, 27), 640Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "42").WithLocation(10, 46) 977Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "()=>1").WithLocation(8, 47)
CodeGen\CodeGenRefReadonlyReturnTests.cs (5)
1048Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "42").WithLocation(6, 25), 1104Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "42").WithLocation(6, 20) 1128Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "42").WithLocation(6, 22), 1155Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "M()").WithLocation(6, 20), 1183Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "b").WithLocation(7, 22),
CodeGen\CodeGenRefReturnTests.cs (3)
2930Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "d.Length").WithLocation(18, 20) 3119Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "d[0]").WithLocation(17, 20) 3155Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "d.Length").WithLocation(14, 26),
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (40)
RefReadonlyParameterTests.cs (5)
2485Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "7").WithLocation(7, 14)); 5447Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "111").WithLocation(11, 17), 5450Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "5").WithLocation(12, 15), 5456Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "5").WithLocation(13, 15), 5459Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "111").WithLocation(13, 21));
RefStructInterfacesTests.cs (2)
3073Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "s1.S2").WithLocation(6, 35), 3639Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "new TSW()").WithLocation(16, 13),
Semantics\CollectionExpressionTests.cs (2)
3812Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "[3]").WithLocation(6, 22)); 5641Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "[]").WithLocation(6, 28));
Semantics\ExtensionOperatorsTests.cs (18)
3093Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "new S()").WithLocation(12, 17), 16431Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "100").WithLocation(6, 13), 16437Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "200").WithLocation(12, 16), 16500Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "100").WithLocation(6, 26) 16542Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "2").WithLocation(11, 33) 16584Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(11, 22) 16657Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(11, 22) 16846Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "2").WithLocation(13, 34), 16855Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "2").WithLocation(18, 33) 16904Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(13, 22), 16913Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(18, 22) 17000Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(13, 22), 17009Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(18, 22) 25435Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(8, 22), 25444Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(12, 22), 25447Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(12, 22), 25506Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(12, 22), 25509Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(12, 22),
Semantics\InlineArrayTests.cs (7)
8663Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "c.F?").WithLocation(17, 28) 8695Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "c.F?").WithLocation(17, 28) 8725Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, ".F").WithLocation(17, 31) 8757Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, ".F").WithLocation(17, 31) 8946Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "M3()[0]").WithLocation(11, 30) 9020Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "M3()[0]").WithLocation(11, 22) 9197Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "M3()").WithLocation(9, 27)
Semantics\PatternMatchingTests3.cs (1)
526Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "b switch { true => x, false => y }").WithLocation(6, 21));
Symbols\UserDefinedCompoundAssignmentOperatorsTests.cs (5)
15832Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(8, 22), 15841Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(12, 22), 15844Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(12, 22), 15902Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(12, 22), 15905Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(12, 22),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (106)
Semantics\AnonymousFunctionTests.cs (10)
1488Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "() => Write(1)").WithLocation(8, 25), 1491Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "static () => Write(2)").WithLocation(11, 25), 1494Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "() => { Write(3); }").WithLocation(14, 25), 1497Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "static () => { Write(4); }").WithLocation(17, 25), 1500Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "() => { }").WithLocation(20, 33), 1503Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "static () => { }").WithLocation(21, 33), 1506Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "delegate() { Write(5); }").WithLocation(23, 25), 1509Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "static delegate() { Write(6); }").WithLocation(26, 25), 1512Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "delegate() { }").WithLocation(29, 33), 1515Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "static delegate() { }").WithLocation(30, 29)
Semantics\ArglistTests.cs (1)
302Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "__refvalue(tr, int)").WithLocation(23, 20)
Semantics\ImplicitObjectCreationTests.cs (1)
2315Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "new()").WithLocation(6, 20)
Semantics\IndexAndRangeTests.cs (5)
269Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "s[^2]").WithLocation(11, 34)); 658Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "arr[0..2]").WithLocation(33, 14), 661Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "arr[0..2]").WithLocation(35, 20)); 775Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "^0").WithLocation(6, 14), 781Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "^0").WithLocation(8, 20));
Semantics\InterceptorsTests.cs (2)
8459Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "new S()").WithLocation(8, 16)); 8479Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "new S()").WithLocation(8, 16));
Semantics\InterpolationTests.cs (13)
14746Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, expression).WithLocation(17, 20) 14805Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "s1").WithLocation(17, 16), 15010Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "s1").WithLocation(15, 16), 15055Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "s").WithLocation(17, 15), 15414Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "r").WithLocation(18, 19), 15417Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "r").WithLocation(18, 19), 15459Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "x").WithLocation(18, 25), 15494Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, @"$""{1}""").WithLocation(13, 16), 15911Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "r").WithLocation(26, 49), 18363Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, stringLiteral).WithLocation(7, 18), 18400Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, stringLiteral).WithLocation(7, 18), 18437Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, stringLiteral).WithLocation(7, 17), 18474Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, stringLiteral).WithLocation(7, 18),
Semantics\NameOfTests.cs (2)
3244Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "0").WithLocation(13, 15), 3253Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "0").WithLocation(14, 22));
Semantics\OverloadResolutionTests.cs (4)
10827Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "2").WithLocation(21, 25) 10924Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "2").WithLocation(31, 23)); 11424Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "(rl, rl)").WithLocation(20, 19), 11427Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "(y, x)").WithLocation(22, 19));
Semantics\RawInterpolationTests_Handler.cs (1)
11089Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, expression).WithLocation(17, 20));
Semantics\RefEscapingTests.cs (36)
524Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "MayNotWrap()").WithLocation(21, 30), 673Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "__refvalue(ai.GetNextArg(), int)").WithLocation(24, 20), 802Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "var _").WithLocation(12, 36), 844Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "var _").WithLocation(7, 36)); 4978Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "new SW()").WithLocation(18, 13), 5583Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "(global, global) = global").WithLocation(9, 9), 8363Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "ReadOnlyVec").WithLocation(11, 51), 8369Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "ReadOnlyVec").WithLocation(12, 31) 8419Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "ReadOnlyVec").WithLocation(11, 58), 8425Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "ReadOnlyVec").WithLocation(12, 38) 8822Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "__refvalue(ai.GetNextArg(), int)").WithLocation(17, 26), 9308Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "100").WithLocation(6, 16), 9314Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "200").WithLocation(12, 19), 9404Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "100").WithLocation(6, 13), 9410Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "200").WithLocation(12, 16), 9571Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "100").WithLocation(6, 13), 9577Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "200").WithLocation(12, 16), 9583Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "x").WithLocation(18, 13), 9589Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "x").WithLocation(24, 16), 9595Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "x").WithLocation(29, 16), 9697Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "x").WithLocation(5, 23)); 9725Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "x").WithLocation(5, 23), 9802Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "x").WithLocation(5, 23)); 9874Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "100").WithLocation(6, 13), 9880Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "200").WithLocation(12, 16), 9932Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "100").WithLocation(6, 26)); 9962Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "2").WithLocation(11, 33)); 9992Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(11, 22)); 10043Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(11, 22)); 10618Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "new S()").WithLocation(12, 17), 10880Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "2").WithLocation(13, 34), 10889Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "2").WithLocation(18, 33)); 10926Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(13, 22), 10935Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(18, 22)); 11000Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(13, 22), 11009Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "1").WithLocation(18, 22));
Semantics\RefFieldTests.cs (14)
713Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "default").WithLocation(7, 34), 5027Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "__refvalue(args.GetNextArg(), int)").WithLocation(7, 20)); 5153Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "3").WithLocation(19, 22)); 5204Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "3").WithLocation(22, 22)); 10779Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "MayCaptureDefaultArg()").WithLocation(10, 16), 10841Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "new object()").WithLocation(10, 23)); 20281Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "2").WithLocation(14, 18)); 26818Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "s1.S2").WithLocation(6, 35), 26885Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, $"s1.S2{op1}").WithLocation(6, 35)); 26960Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "s1[i]").WithLocation(6, 40), 26993Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "s1[i]").WithLocation(6, 40)); 29295Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "2").WithLocation(5, 28)); 30643Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "_").WithLocation(5, 27)); 30671Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "_").WithLocation(6, 27));
Semantics\RefLocalsAndReturnsTests.cs (16)
1149Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "42").WithLocation(6, 34)); 1523Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "rp").WithLocation(7, 20)); 1738Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "2 + 2").WithLocation(6, 20), 1741Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "2").WithLocation(11, 20), 1744Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "null").WithLocation(16, 20), 1747Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "VoidMethod()").WithLocation(23, 20), 1750Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "P1").WithLocation(30, 20) 1779Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "2 + 2").WithLocation(9, 27), 1782Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "2").WithLocation(10, 27), 1785Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "null").WithLocation(11, 27), 1788Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "VoidMethod()").WithLocation(12, 27), 1791Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "P1").WithLocation(13, 27)); 3961Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "P").WithLocation(8, 20)); 3982Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "this[0]").WithLocation(8, 20)); 4102Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "L()").WithLocation(11, 20)); 4123Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, "d()").WithLocation(8, 20));
Semantics\Utf8StringsLiteralsTests.cs (1)
3802Diagnostic(ErrorCode.ERR_RefReturnLvalueExpected, @"""cat""u8").WithLocation(7, 26)