CollinAlpert / Lombok.NET

.NET adaptation for Java's Lombok using Source Generators.
MIT License
309 stars 16 forks source link

Async and AsyncOverload #40

Closed xafero closed 7 months ago

xafero commented 7 months ago

Does it make sense to generate an async method with "CancellationToken token = default"?

A synchronous one without it and the async one with abort option.

CollinAlpert commented 7 months ago

For the [Async] attribute it wouldn't make sense, since the implementations leverage Task.FromResult and Task.CompletedTask; both of which cannot be used with a CancellationToken.

Using [AsyncOverloads] already generates methods which accept a default CancellationToken.