Stephen Toub

Results 296 comments of Stephen Toub

> the language would also have to be modified to permit static types to be passed as generic type arguments, Yes > most likely along with a new type of...

> In your example, what the generic constrain could be ? My example would be augmented to instead be like: ```C# using System; static class C : I { public...

> I don't see the advantages over always putting a semicolon. Yes, it looks a little strange Avoiding looking strange is an advantage. It may not be hugely compelling, but...

> How can it be happening elsewhere, if the code doesn't compile without the semicolon? Source generators can have many different paths they take to output the source, in many...

> Isn't this also code that a human is less likely to have to read? "have to read", sure. But it's code being emitted into the project. It's part of...

> you very likely wouldn't be reaching for a label to begin with, especially not at the end of a block. This situation arises specifically because the code is generated...

> And the solution is to add yet another statement (that you'd have to step through)? You already step through it. If I have: ```C# A(); Label:; B(); ``` and...

> This doesn't prevent non-generator code from using it And that's the problem. Then we change the generator, and code breaks.

> Something like an assembly-level AsyncMethodBuilderAttribute that could be applied. See https://github.com/dotnet/csharplang/issues/1407. But such an approach is both way too heavy for this and also insufficient: there's no way a...

> Another option would be the ability to override GetAwaiter() used for pattern-based await operations That's basically what this is.