Skip to content

Support for AsyncVoidMethodBuilder, AsyncValueTaskMethodBuilder and AsyncIteratorMethodBuilder #122

@igitur

Description

@igitur

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions