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

Implement interface inheritance #35

Open
iCodeSometime opened this issue Feb 27, 2024 · 2 comments
Open

Implement interface inheritance #35

iCodeSometime opened this issue Feb 27, 2024 · 2 comments
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@iCodeSometime
Copy link

When two classes inherit from each other, it would be nice if the interfaces did also.

[GenerateAutomaticInterface]
public class Parent : IParent
{
    public void ParentMethod() { }
}
[GenerateAutomaticInterface]
public class Child : Parent, IChild
{
    public void ChildMethod() { }
}

Would generate

public interface IParent
{
    public void ParentMethod();
}
public interface IChild : IParent
{
    public void ChildMethod();
}
@ChristianSauer ChristianSauer added enhancement New feature or request wontfix This will not be worked on labels Aug 6, 2024
@ChristianSauer
Copy link
Collaborator

I would be open to a PR but probably will not implement it myself

@ChaseFlorell
Copy link
Contributor

I achieve this by chaining my partial interfaces manually. It's minimal effort to achieve what you're looking to do and doesn't introduce a POLA violation.

public partial interface IParent;
public partial interface IChild : IParent;

[GenerateAutomaticInterface]
public class Parent : IParent
{
    public void ParentMethod() { }
}
[GenerateAutomaticInterface]
public class Child : Parent, IChild
{
    public void ChildMethod() { }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants