On 8/17/07, Garrett Smith <[EMAIL PROTECTED]> wrote:
> 9.6.2 It is an error for the 'this' or 'super' expression to appear in
> the body of a static method.
>
> 1. Is this error mentioned a compile-time error?

Compile-time. In general, any error that can be detected at
compile-time is a compile-time error.

> 2. Why does 'this' in a static method generate an error? (it shouldn't
> refer to the class?)

'this' always refers to an instance. Inside a class, it would be
confusing if 'this' refers sometimes to the instance and sometimes to
the class, depending on one attribute of the containing method.

Cormac, could the Self Proposal be extended here to allow 'Self' (or
my preference, 'this type') to refer to the class in this context?


Peter
_______________________________________________
Es4-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es4-discuss

Reply via email to