[antlr-interest] anybody get bitten by ANTLR's AST interface requirement

Sohail Somani sohail at taggedtype.net
Fri Jan 20 17:49:31 PST 2006


On Fri, 2006-01-20 at 09:49 +0100, Martin Probst wrote:
> A 1.5 feature I consider quite important never gets mentioned btw:
> overriding methods can now declare a subclass as the return type, e.g.
> if you have "class B extends A {}" and some method "A doFoo()" you can
> override it to "B doFoo()". User correctly this can significantly
> enhance APIs and type safety.

I think these are called covariant returns in the C++ world. Are they
the same idea?

Sohail



More information about the antlr-interest mailing list