Skip to content

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

@mtren

Description

@mtren

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions