Problem with method references
Peter Levart
peter.levart at marand.si
Fri Jan 14 01:58:13 PST 2011
On 01/14/11, Maurizio Cimadamore wrote:
> > I see that referencing instance methods from static context is a desirable feature, but syntax-wise I aggree with Neal that the same expression should not change its meaning if moved from static to instance context or vice-versa (when both contexts are legal). So I propose that the syntax:
> >
> > #methodName
> >
> > be made illegal for referencing instance methods from static context.
> I agree - since #methodName is essentially a shortcut for
> this#methodName, it is sensible to reject it in a static context.
I don't know if we should allways reject #methodName in static context. Only if it refers to instance method. If it refers to static method, it should be a shourtcut for:
ClassName#methodName
analogous to static method invocation.
Peter
> Thanks for the example - I will make sure to add it to our regression
> tests as soon as I add support for #this.
>
> Maurizio
>
More information about the lambda-dev
mailing list