Interesting, few months ago I was trying to discuss something very similar in my post about clone-like methods
Effectively it was a call for something very similar to proposed here This-type
Actually that post was quite verbose, but in general it was suggested 2 approaches to solve this problem:
- make
This
type concrete only in final classes (as it was actually done in Rust as far as I know/understand) - make some possibility to somehow declare factory method which calls constructor indirectly - but this approach should also introduce some new form of constraint - non abstract sub class of that constraint class should always have that constructor, with signature matching to intended factory method