daver32 / InterfaceGenerator

A simple source generator that creates interfaces by implementations.
MIT License
36 stars 13 forks source link

Feature Request: Init only setters #2

Closed andi0b closed 3 years ago

andi0b commented 3 years ago

This library seems not to support init only setters from c# 9

how to reproduce

Tested on 1.0.5 on net6.0

Given this code:

[InterfaceGenerator.GenerateAutoInterface]
class Class : IClass
{
    public string Property { get; init; }
}

AutoInterface creates this interface:

internal partial interface IClass
{
    string Property { get; set; }
}

but it should be:

internal partial interface IClass
{
    string Property { get; init; }
}
daver32 commented 3 years ago

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