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

Feature Request: Support Records #1

Closed
andi0b opened this issue Aug 13, 2021 · 1 comment
Closed

Feature Request: Support Records #1

andi0b opened this issue Aug 13, 2021 · 1 comment

Comments

@andi0b
Copy link

andi0b commented Aug 13, 2021

This library (1.0.5 on net6.0) works perfectly for me, thanks for the great work!

What I stumbled upon using it was, that records are not supported. It may need some fine tuning to properly support them though.

// records don't work at all for now
[InterfaceGenerator.GenerateAutoInterface]
record Record : IRecord
{
    public void Method(){}
}

// I expect it to generate an interface like that:
internal partial interface IRecord
{
    string Property { get; init; }
    void Method();
    void Deconstruct(out string Property);
}
// classes work fine
[InterfaceGenerator.GenerateAutoInterface]
class Class : IClass
{
    public string Property { get; set; }
    public void Method(){}
}

// this generates a proper interface:
internal partial interface IClass
{
    string Property { get; set; }
    void Method();
}
@daver32
Copy link
Owner

daver32 commented Aug 15, 2021

I've added support for that now, check out the newest version

@daver32 daver32 closed this as completed Aug 15, 2021
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

2 participants