The compiler can detect code that cannot be reached, and throws warnings
about that; how, particularly, is "require-x-before-y" really any different?
Conceptually, these seem like very similar concepts, and I don't see why the
compiler mechanisms that do dead-code detection could not be adapted for
this purpose as well. Is it just that nobody has bothered to teach the
compiler that particular trick, or is there something more subtle I'm not
seeing?
>> Hi,
>>
[quoted text clipped - 9 lines]
>
> John Saunders
John Saunders - 06 Jan 2005 22:51 GMT
> The compiler can detect code that cannot be reached, and throws warnings
> about that; how, particularly, is "require-x-before-y" really any
[quoted text clipped - 5 lines]
> the compiler that particular trick, or is there something more subtle I'm
> not seeing?
The compiler knows the code paths within a method and can determine that a
piece of code might not be reached. But if you're talking about a publicly
accessible property, the compiler has no way to determine what piece of code
might ultimately set that property. It might be set by code which is not
even in the same compilation.
John Saunders