Skip to content
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

Support for AsyncVoidMethodBuilder, AsyncValueTaskMethodBuilder and AsyncIteratorMethodBuilder #122

Open
igitur opened this issue Sep 26, 2023 · 1 comment

Comments

@igitur
Copy link

igitur commented Sep 26, 2023

Hi,

I noticed that in

if (i.Operand is FieldReference field && field.FieldType.FullName.StartsWith(typeof(AsyncTaskMethodBuilder).FullName))
only AsyncTaskMethodBuilder is supported. This causes MethodBoundaryAspect.Fody to choke on some other async methods.

e.g. if I have a class:

[MyAspect]
public class AsyncClass
{
    public async void MyVoidMethod()
    {
        await Task.Delay(10);
    }

    public async ValueTask<int> MyValueTask()
    {
        await Task.Delay(10);
        return 10;
    }    
}

TODO: I still have to add an example for Async iterators, but I think you'll get the idea.

I can try my hand at a PR, but just want to check whether support for these are deliberately omitted or any pitfulls that I should be aware of.

@Ralf1108
Copy link
Collaborator

Hi @igitur, we would welcome PR if they improve the MBA.
The support for async methods where done by @keith-anders and unfortunatly he is not active anymore. So I am not aware of any reasons why it was not included. Maybe there wasn't a need for it.
Please feel free to improve the support for async methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants