111 references to WRN_UnobservedAwaitableExpression
Microsoft.CodeAnalysis.CSharp (4)
Binder\Binder_Statements.cs (1)
679
Error(diagnostics, ErrorCode.
WRN_UnobservedAwaitableExpression
, expression.Syntax);
Errors\ErrorFacts.cs (2)
392
case ErrorCode.
WRN_UnobservedAwaitableExpression
:
1494
case ErrorCode.
WRN_UnobservedAwaitableExpression
:
Generated\ErrorFacts.Generated.cs (1)
150
case ErrorCode.
WRN_UnobservedAwaitableExpression
:
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
CodeGen\CodeGenDeconstructTests.cs (1)
6684
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "System.Threading.Tasks.Task.Delay(new System.TimeSpan(0))").WithLocation(6, 9)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (106)
Semantics\BindingAsyncTests.cs (106)
1606
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "F1()"),
1609
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "F1()"),
1612
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "F1()"),
1615
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "F1()"),
1618
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "F1()"),
1621
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "F1()"),
1624
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "F2(false)"));
1655
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Goo()"));
1695
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Goo()"),
1698
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Goo()"),
1701
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Goo()"),
1749
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Goo()"),
1752
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "bar()"),
1761
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Goo()"));
1804
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "i.MethExt()").WithLocation(19, 9),
1807
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Goo(1)").WithLocation(20, 9),
1858
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Goo()"),
1867
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Goo()"),
1910
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Goo()"),
1919
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Goo()"),
1981
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Meth(1)"),
1984
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "f()"),
1987
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, @"Meth("""")"),
1990
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "ff()"),
1993
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "(await ff())()"));
2105
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Meth(x)"),
2108
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Meth(x)"),
2111
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "f()"),
2114
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Meth(new MyDisp())"),
2117
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, @"Task.Run(async () =>
2164
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Meth(1)"),
2167
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, @"Meth("""")"),
2170
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Meth((decimal?)2)"),
2230
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "i.Meth(1)"),
2233
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "f()"),
2236
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, @"i.Meth("""")"),
2239
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "ff()"),
2242
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "(await ff())()"));
2296
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Meth(1)"),
2299
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, @"Meth("""")"),
2302
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Meth((decimal?)null)"));
2344
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, @"Meth("""", null)").WithLocation(19, 9),
2347
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Meth(Task.Run(async () => 1), Meth(1))").WithLocation(25, 9),
2402
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Meth(await Meth(int.MaxValue) + 1)"),
2405
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Meth(long.MinValue - 1)"),
2408
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Meth((int?)null)"));
2485
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Meth(1)"),
2536
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, @"Meth("""")"),
2539
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Meth((float?)null)"),
2542
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Meth(1)"),
2545
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Meth(5m)"),
2548
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, @"Meth("""")"),
2551
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Meth((string)null)"));
2602
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "testB.Meth2()"),
2605
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "testB.Meth((float?)null)"),
2608
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "testB.Meth(1)"),
2611
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "testB.Meth<decimal>()"),
2614
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "testB.Meth2()"));
2643
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Goo()"));
2678
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "s.ExMeth()"));
2716
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Goo()"),
2719
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Goo()"));
2766
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Goo()"));
2843
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "del(y)"));
3002
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "test.Meth()").WithLocation(21, 13),
3005
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "test.Meth()").WithLocation(26, 13));
3047
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Goo()"));
3081
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Goo()"),
3084
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "test.Goo()"));
3098
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Task.FromResult(1)").WithLocation(2, 1),
3101
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Task.FromResult(2)").WithLocation(3, 1));
3118
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Task.FromResult(1)").WithLocation(2, 1),
3121
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "Task.FromResult(2)").WithLocation(3, 1));
3839
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "XAsync()"),
3842
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "XAsync()"),
3845
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "YAsync()"),
3848
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "XAsync()"),
3960
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "c.M()").WithLocation(7, 1),
3963
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "c.MAsync()").WithLocation(8, 1),
3966
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "c.M()").WithLocation(10, 47),
3969
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "c.MAsync()").WithLocation(11, 19),
3972
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "c.MAsync()").WithLocation(12, 47),
3975
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "i.M()").WithLocation(15, 1),
3978
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "i.MAsync()").WithLocation(16, 1),
3981
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "i.M()").WithLocation(18, 47),
3984
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "i.MAsync()").WithLocation(20, 47),
3987
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "c.M()").WithLocation(31, 9),
3990
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "c.MAsync()").WithLocation(32, 9),
3993
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "c.M()").WithLocation(34, 55),
3996
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "c.MAsync()").WithLocation(35, 27),
3999
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "c.MAsync()").WithLocation(36, 55),
4002
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "i.M()").WithLocation(39, 9),
4005
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "i.MAsync()").WithLocation(40, 9),
4008
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "i.M()").WithLocation(42, 55),
4011
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "i.MAsync()").WithLocation(44, 55)
4062
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "c.M()").WithLocation(5, 1),
4065
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "c.MAsync()").WithLocation(6, 1),
4068
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "c.MAsync()").WithLocation(8, 19),
4071
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "i.M()").WithLocation(11, 1),
4074
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "i.MAsync()").WithLocation(12, 1),
4077
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "c.MAsync()").WithLocation(20, 5)
4121
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "c.M()").WithLocation(5, 1),
4124
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "c.MAsync()").WithLocation(6, 1),
4127
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "c.MAsync()").WithLocation(8, 19),
4130
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "i.M()").WithLocation(11, 1),
4133
Diagnostic(ErrorCode.
WRN_UnobservedAwaitableExpression
, "i.MAsync()").WithLocation(12, 1)