Support constructors
latonz opened this issue · comments
Lars commented
Pretty much the title. It would be nice to have support for constructors. However, this may not fit the current extension method approach... but extern method could be exposed directly.
using PrivateProxy;
public class Sample
{
private Sample(int x) {}
}
[GeneratePrivateProxy(typeof(Sample))]
partial struct SampleProxy;
// Generated
partial struct SampleProxy(Sample target)
{
[UnsafeAccessor(UnsafeAccessorKind.Constructor)]
public static extern Sample CreateSample(int x);
}
BTW thank you for this nice source generator!
Yoshifumi Kawai commented
Okay, that suggestion sounds good!