posted 13 years ago
Is that something you'd prefer?
I guess you want something more like where it uses type inference to determine T and instantiate it, but that's simply not possible.
Perhaps generics can be extended in the future, something like this:
Omitting the constructor argument types will then use the current situation, where instantiation is impossible.
However, because of type erasure I doubt this will ever happen. T is no longer known at run time. For this to work the methods would need to be inlined, as that's the only way to link T and its actual value. Or type erasure needs to be removed, but that would cause a lot of compatibility issues.