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

Nullable Annotations should be taken over to the interface. #19

Open
mtren opened this issue May 11, 2023 · 0 comments
Open

Nullable Annotations should be taken over to the interface. #19

mtren opened this issue May 11, 2023 · 0 comments

Comments

@mtren
Copy link

mtren commented May 11, 2023

Curent Behaviour:
For the class

[InterfaceGenerator.GenerateAutoInterface(VisibilityModifier = "public")]
public class AClass : IAClass
{

    [return: NotNullIfNotNull(nameof(content))]
    public byte[]? TheMethod(byte[]? content)
    {
        if (content == null) return content;
        return content;
    }
}

this interface is generated:

public partial interface IAClass
{
    byte[]? TheMethod(byte[]? content);
}

Excpected Interface:

public partial interface IAClass
{
    [return: NotNullIfNotNull(nameof(content))]
    byte[]? TheMethod(byte[]? content);
}

Also other paremeter Attributes should be considered. Eg. MaybeNullWhen() or EnumeratorCancellation.

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

1 participant