why can’t we have constructors in an interface? grrr.
about the “language has no syntax for this” – it’s as simple as 1-2-3. ISomeType something= new<ISomeType> typeVariable(arg, arg2, arg3), f.ex. Static checking, no grammar conflicts, all good.
Without the syntax it’s easy, too, either with Factory pattern, or w/reflection, but it’s not so nice
I surely miss python-style callables/constructors unification.
Advertisements