172 references to ERR_RefReturnLocal
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder.ValueChecks.cs (1)
888
Error(diagnostics, inUnsafeRegion ? ErrorCode.WRN_RefReturnLocal : ErrorCode.
ERR_RefReturnLocal
, node, localSymbol);
Errors\ErrorFacts.cs (1)
1728
case ErrorCode.
ERR_RefReturnLocal
:
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (7)
CodeGen\CodeGenRefConditionalOperatorTests.cs (3)
700
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "local1").WithArguments("local1").WithLocation(15, 27)
731
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "local2").WithArguments("local2").WithLocation(14, 37)
767
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "local2").WithArguments("local2").WithLocation(14, 38)
CodeGen\CodeGenRefReadonlyReturnTests.cs (4)
977
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "local").WithArguments("local").WithLocation(11, 30),
983
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "local").WithArguments("local").WithLocation(15, 31),
993
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "local").WithArguments("local").WithLocation(11, 30),
1021
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "local").WithArguments("local").WithLocation(8, 25),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (163)
Semantics\NullableReferenceTypesTests.cs (2)
1235
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "r").WithArguments("r").WithLocation(13, 24),
1241
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "r").WithArguments("r").WithLocation(15, 24));
Semantics\RefEscapingTests.cs (20)
339
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "sp").WithArguments("sp").WithLocation(23, 34),
345
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "sp").WithArguments("sp").WithLocation(29, 34),
361
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "sp").WithArguments("sp").WithLocation(29, 34),
882
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "var z").WithArguments("z").WithLocation(12, 35),
888
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "z").WithArguments("z").WithLocation(17, 35),
1290
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "s1").WithArguments("s1").WithLocation(7, 20),
1293
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "s2").WithArguments("s2").WithLocation(12, 20),
1296
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "s3").WithArguments("s3").WithLocation(17, 20),
1299
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "s4").WithArguments("s4").WithLocation(22, 20),
1302
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "s5").WithArguments("s5").WithLocation(28, 20),
1305
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "s6").WithArguments("s6").WithLocation(33, 20));
1358
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "s1").WithArguments("s1").WithLocation(6, 20),
1361
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "s2").WithArguments("s2").WithLocation(11, 20),
1364
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "s3").WithArguments("s3").WithLocation(16, 20),
1367
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "s4").WithArguments("s4").WithLocation(21, 20),
1370
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "s5").WithArguments("s5").WithLocation(27, 20),
1373
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "s6").WithArguments("s6").WithLocation(32, 20));
1802
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "outer").WithArguments("outer").WithLocation(16, 33),
3192
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "local").WithArguments("local").WithLocation(17, 47),
6919
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "int i").WithArguments("i").WithLocation(12, 27));
Semantics\RefFieldTests.cs (136)
2947
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(11, 79),
2953
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(12, 78),
2959
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(13, 75),
2965
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(14, 79),
2971
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(29, 70),
2977
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(30, 83)
2987
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(11, 79),
2993
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(12, 78),
2999
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(13, 75),
3023
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(29, 70),
3029
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(30, 83)
3077
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(9, 55),
3083
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(10, 54),
3089
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(11, 51),
3095
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(12, 55)
3105
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(9, 55),
3111
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(10, 54),
3117
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(11, 51),
3254
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "u").WithArguments("u").WithLocation(23, 30),
3260
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "u").WithArguments("u").WithLocation(29, 29),
3266
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "u").WithArguments("u").WithLocation(35, 26),
3272
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "u").WithArguments("u").WithLocation(41, 30),
3278
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(47, 27),
3284
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(53, 27),
3290
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(59, 27),
3296
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(65, 27),
3302
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(71, 26),
3308
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(77, 23),
3314
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(83, 26),
3320
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(89, 23),
3326
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(95, 27)
3336
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "u").WithArguments("u").WithLocation(23, 30),
3342
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "u").WithArguments("u").WithLocation(29, 29),
3348
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "u").WithArguments("u").WithLocation(35, 26),
3354
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(47, 27),
3360
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(53, 27),
3366
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(59, 27),
3372
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(65, 27),
3378
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(71, 26),
3384
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(77, 23),
3390
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(83, 26),
3396
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(89, 23)
3681
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(14, 74),
3687
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(15, 73),
3693
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(16, 70),
3717
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(32, 65),
3723
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(33, 78),
3729
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(34, 75)
3784
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(12, 47),
3790
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(13, 46),
3796
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(14, 43),
3940
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "u").WithArguments("u").WithLocation(26, 26),
3946
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "u").WithArguments("u").WithLocation(32, 25),
3952
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "u").WithArguments("u").WithLocation(38, 22),
3958
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(50, 23),
3964
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(56, 23),
3970
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(62, 23),
3976
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(68, 23),
3982
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(74, 22),
3988
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(80, 19),
3994
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(86, 22),
4000
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(92, 19)
4039
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "y").WithArguments("y").WithLocation(9, 82),
4699
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i1").WithArguments("i1").WithLocation(14, 24),
4705
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i1").WithArguments("i1").WithLocation(16, 24),
4769
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i1").WithArguments("i1").WithLocation(14, 23),
4775
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i1").WithArguments("i1").WithLocation(16, 23),
4821
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "y").WithArguments("y").WithLocation(17, 23));
4860
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "y").WithArguments("y").WithLocation(17, 19),
4866
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "y").WithArguments("y").WithLocation(21, 22));
4905
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "y").WithArguments("y").WithLocation(17, 19),
4911
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "y").WithArguments("y").WithLocation(21, 22));
5078
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i1").WithArguments("i1").WithLocation(10, 25),
5084
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i2").WithArguments("i2").WithLocation(15, 22),
5129
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "x1").WithArguments("x1").WithLocation(11, 25),
5135
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "x2").WithArguments("x2").WithLocation(17, 22),
10264
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i").WithArguments("i").WithLocation(6, 34),
10323
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "o").WithArguments("o").WithLocation(6, 27),
17274
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i").WithArguments("i").WithLocation(18, 29),
17849
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "l0").WithArguments("l0").WithLocation(7, 20),
17852
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "l1").WithArguments("l1").WithLocation(12, 20),
17855
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "l2").WithArguments("l2").WithLocation(17, 20),
17858
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "l3").WithArguments("l3").WithLocation(22, 20));
17937
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "l0").WithArguments("l0").WithLocation(7, 20),
17940
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "l1").WithArguments("l1").WithLocation(12, 20),
17943
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "l2").WithArguments("l2").WithLocation(17, 20),
17946
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "l3").WithArguments("l3").WithLocation(22, 20));
18591
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t").WithArguments("t").WithLocation(19, 36));
18635
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i2").WithArguments("i2").WithLocation(16, 35),
18644
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i4").WithArguments("i4").WithLocation(25, 28));
18685
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "y2").WithArguments("y2").WithLocation(16, 25),
18691
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "x4").WithArguments("x4").WithLocation(25, 18));
18735
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i2").WithArguments("i2").WithLocation(16, 39),
18744
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i4").WithArguments("i4").WithLocation(25, 32));
18780
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "y2").WithArguments("y2").WithLocation(11, 29),
18786
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "x4").WithArguments("x4").WithLocation(20, 22));
19252
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t1").WithArguments("t1").WithLocation(11, 29),
19261
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "t3").WithArguments("t3").WithLocation(24, 27),
19659
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i1").WithArguments("i1").WithLocation(10, 18),
21079
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "field = ref x").WithArguments("x").WithLocation(20, 25),
21082
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "field = ref x").WithArguments("x").WithLocation(29, 25),
21085
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "field = ref x").WithArguments("x").WithLocation(36, 21)
21144
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "x").WithArguments("x").WithLocation(20, 27),
21150
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "x").WithArguments("x").WithLocation(29, 27),
21156
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "x").WithArguments("x").WithLocation(36, 23)
21212
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "field = ref x").WithArguments("x").WithLocation(18, 42),
21215
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "field = ref x").WithArguments("x").WithLocation(25, 38),
21328
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "field = ref x").WithArguments("x").WithLocation(20, 32),
21331
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "field = ref x").WithArguments("x").WithLocation(29, 32),
21334
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "field = ref x").WithArguments("x").WithLocation(36, 28)
21867
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "s").WithArguments("s").WithLocation(11, 20));
21985
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "s").WithArguments("s").WithLocation(11, 20));
22284
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "r2").WithArguments("r2").WithLocation(12, 27),
22287
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "r2").WithArguments("r2").WithLocation(13, 20));
22352
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "r2").WithArguments("r2").WithLocation(12, 27),
22355
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "r2").WithArguments("r2").WithLocation(13, 20));
22619
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "r").WithArguments("r").WithLocation(6, 28),
22862
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i").WithArguments("i").WithLocation(16, 28));
22915
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i").WithArguments("i").WithLocation(14, 28),
22921
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i").WithArguments("i").WithLocation(24, 28),
22927
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i").WithArguments("i").WithLocation(29, 28));
22981
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i").WithArguments("i").WithLocation(14, 27),
22987
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i").WithArguments("i").WithLocation(24, 27),
22993
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i").WithArguments("i").WithLocation(29, 27));
23648
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i2").WithArguments("i2").WithLocation(11, 25),
23654
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i4").WithArguments("i4").WithLocation(21, 23),
23660
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i6").WithArguments("i6").WithLocation(31, 36));
23730
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i3").WithArguments("i3").WithLocation(17, 27));
23854
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i").WithArguments("i").WithLocation(16, 42),
25790
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "T t").WithArguments("t").WithLocation(4, 40));
27603
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i").WithArguments("i").WithLocation(13, 27));
27760
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "local").WithArguments("local").WithLocation(18, 16),
27766
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "local").WithArguments("local").WithLocation(19, 15)
28035
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "var b1").WithArguments("b1").WithLocation(4, 36),
28041
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "var b2").WithArguments("b2").WithLocation(5, 45));
28680
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "s2").WithArguments("s2").WithLocation(14, 35)
Semantics\RefLocalsAndReturnsTests.cs (5)
1751
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "l").WithArguments("l").WithLocation(18, 24),
2177
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "M1").WithArguments("M1").WithLocation(36, 32),
2189
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "M2").WithArguments("M2").WithLocation(46, 32),
3545
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "i").WithArguments("i").WithLocation(7, 20));
3773
Diagnostic(ErrorCode.
ERR_RefReturnLocal
, "j").WithArguments("j").WithLocation(7, 26),