Skip to content

Commit 69035d7

Browse files
committed
repro code
#470
1 parent b2fe360 commit 69035d7

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

ValidCode/Async.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,18 @@ public async Task Calls()
8282
await System.Windows.Threading.Dispatcher.CurrentDispatcher.Invoke(() => Task.FromResult(42)).ConfigureAwait(false);
8383
}
8484

85+
public static Task<IDisposable> TaskFromResult()
86+
{
87+
var disposable = new Disposable();
88+
return Task.FromResult<IDisposable>(disposable);
89+
}
90+
91+
public static ValueTask<IDisposable> ValueTask()
92+
{
93+
var disposable = new Disposable();
94+
return new ValueTask<IDisposable>(disposable);
95+
}
96+
8597
public static async Task<string?> Bar1Async()
8698
{
8799
using (var stream = await ReadAsync(string.Empty))

0 commit comments

Comments
 (0)