-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling method with generic return type and this keyword will omit return type #44
Comments
The same thing happens when invoking static methods with generic return type internal static partial class Class6
{
[Zomp.SyncMethodGenerator.CreateSyncVersion]
public static async Task<T> FooAsync<T>(CancellationToken cancellationToken = default)
{
return await Class6.InnerFooAsync<T>(cancellationToken).ConfigureAwait(false);
}
[Zomp.SyncMethodGenerator.CreateSyncVersion]
private static async Task<T> InnerFooAsync<T>(CancellationToken cancellationToken = default)
{
await Task.Delay(100, cancellationToken);
return default;
}
} |
Another example using public Task<int> FooAsync()
{
return Task.FromResult<int>(1);
} |
@persn Slightly more complex problem than anticipated. Will try fixing in the next week. |
@persn The fix is in version 1.3.5 on nuget. Will get to the rest of your issues in the next week or next weekend. Please let me know if any of the other issues are a showstopper and I'll look at them first. |
@virzak I think all the issues I've reported needs to be resolved before I can use this source generator in production code, maybe except the |
@persn Will complete at earliest convenience. Just having some urgent client deliverables this week. Cheers and thanks for understanding. |
Like the title says.. Using the following code
Generates the following
When I use the
this
keyword when callingInnerFooAsync
the return type magically vanishes, resulting in errorThis is not a big deal for me personally since I figured out that removing thethis
keyword solves the issue, it's excessive and redundant anyway, but it's going to be a real headscratcher for anyone else who runs into this problem.Actually in some cases you have to explicitly use
this
to get the correct behavior so it's quite important that this works.The text was updated successfully, but these errors were encountered: