[antlr-interest] anybody get bitten by ANTLR's AST
interfacerequirement
Hill, Robert
rhill03 at eds.com
Tue Jan 24 03:10:47 PST 2006
You can do this in C#2 I believe.
'Covariance' IIRC.
--
Rob Hill
EDS - Hallamshire Business Park
F1E/087
Sheffield
T: +44 (0) 114 291 1928
M: +44 (0) 791 732 1227
E: rhill03 at eds.com
>-----Original Message-----
>From: antlr-interest-bounces at antlr.org
>[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Martin Probst
>Sent: 24 January 2006 10:00
>To: antlr-interest at antlr.org
>Subject: Re: [antlr-interest] anybody get bitten by ANTLR's
>AST interfacerequirement
>
>In code:
>
>class X { .. }
>class Y extends X { .. }
>
>class A {
> X foo();
>}
>
>class B extends A {
> Y foo(); // <-- !!!
>}
>
>The class B with the overriding foo() returning Y was not
>possible before, and it can really enhance complicated APIs.
>E.g. if you move down the API abstraction level you can now
>have the more concrete classes also return more concrete
>types, and that is nice.
>
>Martin
>
>
More information about the antlr-interest
mailing list