On Tue, 09 Feb 2010 16:22:35 +0000, Steven Simpson <>
wrote, quoted or indirectly quoted someone who said :
>Could that restriction not be loosened in a compiler-verifiable way,
>i.e. check that no statement prior to super() uses 'this' (explicitly or
>implicitly)?
It would have to chase any method calls recursively. They might
dynamically load code. I don't think you can tell in general.
Perhaps you could allow an expression involving only literals, static
finals and parameters.
The restriction is onerous. Often I want to transform the constructor
parameters to pass to the super constructor.
Oddly you are allowed method calls in the superconstructor, which
could do bloody well anything.
--
Roedy Green Canadian Mind Products
http://mindprod.com
Every compilable program in a sense works. The problem is with your unrealistic expections on what it will do.