87 references to ERR_ByRefTypeAndAwait
Microsoft.CodeAnalysis.CSharp (3)
Errors\ErrorFacts.cs (1)
616
or ErrorCode.
ERR_ByRefTypeAndAwait
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (2)
94
diagnostics.Add(ErrorCode.
ERR_ByRefTypeAndAwait
, syntax.Location, local.TypeWithAnnotations);
112
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)
10809
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"{
10971
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "F").WithArguments("S").WithLocation(9, 17)
CodeGen\CodeGenAwaitForeachTests.cs (3)
3028
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var s in new C())
3077
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var x in new C())
3119
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"foreach (var x in new C())
CodeGen\CodeGenAwaitUsingTests.cs (5)
5040
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "new R()").WithArguments("R").WithLocation(6, 16)
5072
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "new R()").WithArguments("R").WithLocation(6, 16)
5315
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "new R()").WithArguments("R").WithLocation(6, 22)
5353
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "new R()").WithArguments("R").WithLocation(7, 22)
5389
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "_ = new R()").WithArguments("R").WithLocation(7, 25)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (40)
RefStructInterfacesTests.cs (24)
12635
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "new S2()").WithArguments("S2").WithLocation(17, 22)
12902
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "new S2()").WithArguments("S2").WithLocation(17, 22)
13150
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "new S2()").WithArguments("S2").WithLocation(19, 22)
13420
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "new T()").WithArguments("T").WithLocation(9, 22)
13675
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "new T()").WithArguments("T").WithLocation(9, 22)
13953
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "new T()").WithArguments("T").WithLocation(13, 22)
16778
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in new S1())
16830
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in new S1())
16891
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in default(TEnumerable))
16958
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in default(TEnumerable))
17150
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in new S1())
17215
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in new S1())
17280
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in new S1())
17364
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in default(TEnumerable))
17452
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in default(TEnumerable))
17545
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in default(TEnumerable))
17642
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in default(TEnumerable))
17726
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in default(TEnumerable))
17801
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in new S1())
17810
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, @"await foreach (var i in new S1())
17890
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "await foreach (var i in new S1()) {}").WithArguments("S2").WithLocation(6, 9)
17897
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "await foreach (var i in new S1()) {}").WithArguments("S2").WithLocation(6, 9)
17969
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "await foreach (var i in default(TEnumerable)) {}").WithArguments("TEnumerator").WithLocation(24, 9)
17976
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)
3503
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "new Lock()").WithArguments("System.Threading.Lock.Scope").WithLocation(9, 15));
3612
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "new Lock()").WithArguments("System.Threading.Lock.Scope").WithLocation(10, 15));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (32)
Semantics\AwaitExpressionTests.cs (1)
414
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "new TypedReference()").WithArguments("System.TypedReference").WithLocation(8, 27));
Semantics\BindingAsyncTests.cs (1)
3261
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "tr").WithArguments("System.TypedReference").WithLocation(17, 19));
Semantics\RefEscapingTests.cs (1)
7904
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)
7389
Diagnostic(ErrorCode.
ERR_ByRefTypeAndAwait
, "h1").WithArguments("System.RuntimeArgumentHandle").WithLocation(9, 7),
7392
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
: