Created
August 31, 2023 19:31
-
-
Save jskeet/cb8d280ae9be1d627ab19e8a10d31488 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Threading.Tasks; | |
class Test | |
{ | |
static async Task Main() | |
{ | |
// (Include the error message in the post.) | |
_ = await Condition() ? await M1() : await M2(); | |
} | |
static Task<bool> Condition() => Task.FromResult(true); | |
static Task M1() => Task.CompletedTask; | |
static Task M2() => Task.CompletedTask; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment