87 references to ERR_ByRefTypeAndAwait
Microsoft.CodeAnalysis.CSharp (3)
Errors\ErrorFacts.cs (1)
617
or ErrorCode.
ERR_ByRefTypeAndAwait
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (2)
87
diagnostics.Add(ErrorCode.
ERR_ByRefTypeAndAwait
, syntax.Location, local.TypeWithAnnotations);
105
diagnostics.Add(ErrorCode.
ERR_ByRefTypeAndAwait
, syntax.Location, parameter.TypeWithAnnotations);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (11)
CodeGen\CodeGenAsyncIteratorTests.cs (1)
928
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "s.F").WithArguments("S").WithLocation(11, 34)
CodeGen\CodeGenAsyncSpillTests.cs (2)
3794
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"{
3907
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "F").WithArguments("S").WithLocation(9, 17)
CodeGen\CodeGenAwaitForeachTests.cs (3)
2098
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var s in new C())
2147
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var x in new C())
2189
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"foreach (var x in new C())
CodeGen\CodeGenAwaitUsingTests.cs (5)
3134
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "new R()").WithArguments("R").WithLocation(6, 16)
3166
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "new R()").WithArguments("R").WithLocation(6, 16)
3409
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "new R()").WithArguments("R").WithLocation(6, 22)
3447
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "new R()").WithArguments("R").WithLocation(7, 22)
3483
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "_ = new R()").WithArguments("R").WithLocation(7, 25)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (40)
RefStructInterfacesTests.cs (24)
12237
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "new S2()").WithArguments("S2").WithLocation(17, 22)
12504
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "new S2()").WithArguments("S2").WithLocation(17, 22)
12752
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "new S2()").WithArguments("S2").WithLocation(19, 22)
13022
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "new T()").WithArguments("T").WithLocation(9, 22)
13277
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "new T()").WithArguments("T").WithLocation(9, 22)
13555
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "new T()").WithArguments("T").WithLocation(13, 22)
16380
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in new S1())
16432
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in new S1())
16493
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in default(TEnumerable))
16560
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in default(TEnumerable))
16752
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in new S1())
16817
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in new S1())
16882
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in new S1())
16966
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in default(TEnumerable))
17054
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in default(TEnumerable))
17147
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in default(TEnumerable))
17244
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in default(TEnumerable))
17328
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in default(TEnumerable))
17403
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in new S1())
17412
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in new S1())
17492
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "await foreach (var i in new S1()) {}").WithArguments("S2").WithLocation(6, 9)
17499
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "await foreach (var i in new S1()) {}").WithArguments("S2").WithLocation(6, 9)
17571
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "await foreach (var i in default(TEnumerable)) {}").WithArguments("TEnumerator").WithLocation(24, 9)
17578
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "await foreach (var i in default(TEnumerable)) {}").WithArguments("TEnumerator").WithLocation(24, 9)
RefUnsafeInIteratorAndAsyncTests.cs (12)
151
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "r").WithArguments("R").WithLocation(6, 11)
203
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "t").WithArguments("System.TypedReference").WithLocation(6, 9)
398
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "y").WithArguments("System.Span<int>").WithLocation(9, 23));
427
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "y").WithArguments("System.Span<int>").WithLocation(9, 32)
494
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "y").WithArguments("System.TypedReference").WithLocation(9, 23));
818
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "y").WithArguments("System.Span<int>").WithLocation(9, 23));
847
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "y").WithArguments("System.Span<int>").WithLocation(9, 32)
876
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "y").WithArguments("System.Span<int>").WithLocation(11, 27));
898
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "y").WithArguments("System.Span<int>").WithLocation(9, 23));
921
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "y").WithArguments("System.Span<int>").WithLocation(10, 23));
1054
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "y").WithArguments("System.TypedReference").WithLocation(9, 23));
1077
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "y").WithArguments("System.TypedReference").WithLocation(10, 23));
Semantics\InlineArrayTests.cs (2)
4843
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"MemoryMarshal.CreateReadOnlySpan(
4901
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"MemoryMarshal.CreateReadOnlySpan(
Semantics\LockTests.cs (2)
3507
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "new Lock()").WithArguments("System.Threading.Lock.Scope").WithLocation(9, 15));
3616
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "new Lock()").WithArguments("System.Threading.Lock.Scope").WithLocation(10, 15));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (32)
Semantics\AwaitExpressionTests.cs (1)
362
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "new TypedReference()").WithArguments("System.TypedReference").WithLocation(8, 27));
Semantics\BindingAsyncTests.cs (1)
3283
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "tr").WithArguments("System.TypedReference").WithLocation(17, 19));
Semantics\RefEscapingTests.cs (1)
7323
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "handle = RentArray<int>(200, out var array)").WithArguments("PooledArrayHandle<int>").WithLocation(20, 19));
Semantics\RefLocalsAndReturnsTests.cs (2)
3326
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "y").WithArguments("System.Span<int>").WithLocation(10, 18)
3493
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "y").WithArguments("System.Span<int>").WithLocation(10, 19)
Semantics\SemanticErrorTests.cs (2)
7344
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "h1").WithArguments("System.RuntimeArgumentHandle").WithLocation(9, 7),
7347
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "h2").WithArguments("System.RuntimeArgumentHandle").WithLocation(13, 7)
Semantics\SpanStackSafetyTests.cs (24)
999
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"foreach (var i in obj)
1141
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"foreach (var i in new C1())
1375
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "local1").WithArguments("System.Span<int>").WithLocation(26, 16),
1381
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "local2").WithArguments("System.Span<int>").WithLocation(35, 16),
1384
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "local1").WithArguments("System.Span<int>").WithLocation(44, 16),
1387
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "local2").WithArguments("System.Span<int>").WithLocation(44, 32)
1444
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "local1").WithArguments("System.Span<int>").WithLocation(22, 16),
1447
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "local2").WithArguments("System.Span<int>").WithLocation(31, 16));
1501
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "c1").WithArguments("System.ReadOnlySpan<char>").WithLocation(28, 17),
1504
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "c2").WithArguments("System.ReadOnlySpan<char>").WithLocation(36, 17));
1545
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "s1").WithArguments("System.Span<int>").WithLocation(25, 13),
1548
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "s4").WithArguments("System.Span<int>").WithLocation(25, 25),
1551
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "s5").WithArguments("System.Span<int>").WithLocation(25, 37));
1599
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "s3 = default(RS)").WithArguments("RS").WithLocation(11, 18),
1602
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "s4 = default(RS)").WithArguments("RS").WithLocation(12, 19),
1605
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "default(RS)").WithArguments("RS").WithLocation(20, 16),
1608
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "s1 = default(RS)").WithArguments("RS").WithLocation(21, 20),
1611
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "s2 = default(RS)").WithArguments("RS").WithLocation(22, 19),
1614
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "s3 = default(RS)").WithArguments("RS").WithLocation(24, 22));
1661
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "s1").WithArguments("System.Span<int>").WithLocation(23, 17),
1664
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "s2").WithArguments("System.Span<int>").WithLocation(28, 17));
1697
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "y").WithArguments("System.Span<int>").WithLocation(11, 9));
1750
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "default(Span<int>)").WithArguments("System.Span<int>").WithLocation(17, 19)
1800
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "default(Span<int>)").WithArguments("System.Span<int>").WithLocation(14, 22)
Semantics\UsingStatementTests.cs (1)
1111
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "c = new S1()").WithArguments("S1").WithLocation(14, 25));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Diagnostics\DiagnosticTest.cs (1)
2971
case ErrorCode.
ERR_ByRefTypeAndAwait
: