InterfaceGenerator
InterfaceGenerator copied to clipboard
Nullable Annotations should be taken over to the interface.
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.