public partial interface IBase<T> {
[RewriteAsync] T Foo();
}
public abstract partial class BaseClass<T> : IBase<T> {
[RewriteAsync] public virtual T Foo() => default;
}
public abstract partial class Middle<T> : BaseClass<T> {
}
public abstract partial class Middle2<T> : Middle<T> {
}
public partial class Impl : Middle2<string> {
[RewriteAsync] public override string Foo() => "haha";
}
public partial class Impl2 : Middle<string> {
[RewriteAsync] public override string Foo() => "hoho";
}
when I check the GeneratedAsync.cs file I can see that Impl2.Foo() and Impl.Foo() methods have different modifiers (vitual Task and override Task).
public partial interface IBase<T> {
Task<T> FooAsync();
Task<T> FooAsync(CancellationToken cancellationToken);
}
public abstract partial class BaseClass<T> {
public virtual Task<T> FooAsync() => this.FooAsync(CancellationToken.None);
public virtual async Task<T> FooAsync(CancellationToken cancellationToken) => default;
}
public partial class Impl {
public virtual Task<string> FooAsync() => this.FooAsync(CancellationToken.None);
public async virtual Task<string> FooAsync(CancellationToken cancellationToken) => "haha";
}
public partial class Impl2 {
public override Task<string> FooAsync() => this.FooAsync(CancellationToken.None);
public override async Task<string> FooAsync(CancellationToken cancellationToken) => "hoho";
}
Given I have the following code:
when I check the
GeneratedAsync.cs
file I can see thatImpl2.Foo()
andImpl.Foo()
methods have different modifiers (vitual Task
andoverride Task
).