quickconstructor icon indicating copy to clipboard operation
quickconstructor copied to clipboard

Base constructor is disregarded if the base is not also marked with the attribute

Open AntonC9018 opened this issue 1 year ago • 0 comments

If I define a base class with a manual constructor, as you'd normally do:

public abstract class Base
{
    private readonly object _value;
    public Base(object v) => _value = v;
}

And then try and generate one for a derived class:

[QuickConstructor]
public sealed partial class Class : Base
{
}

It will generate invalid code, completely disregarding the base constructor. It works if you mark the base class with that though.

This could be helpful if you don't own the source code of the Base class and can't just go ahead and add the attribute to it.

AntonC9018 avatar Jun 23 '23 12:06 AntonC9018