Piotr said:
How about a bit different syntax for /type aliasing/ (good term?):
class FooInt = Foo<Comparator<Integer>>;
?
Of course, "tell the truth" rule is still needed, e.g.:
interface IntComparator = Comparator<Integer>;
class FooInt = Foo<IntComparator>;
I also like this, if it's added at all...
I have some concern about adding a new language construct
simply because, well, it's adding a new language construct.
It's much easier to add new features than it is to remove
old ones, with the consequence that language complexity
goes up.
In this particular case, many of the benefits (but not all,
as others have pointed out!) of C's typedef can be provided
already by subclassing. So is it worth adding the above for
the net gain? Personally, I wouldn't do it but I'm certainly
not going to lose any sleep if it is done - and would
most likely use it, hypocrite that I am.
Incidently, I would argue that it would be better to do
the above than to implement the equivalent using a
preprocessor. The problem with a preprocessor approach
is that the change is cosmetic and not carried into
the runtime (hmmm, kinda like the current implementation
of generics...) *or* the compilation. Error messages
become more confusing, for example.
Using a preprocessor to *experiment* with a possible new
language construct *is* fair game, however - to see if the
perceived gains are worth it...