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