[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-lambda-dev
Subject: Re: Bug in javac and eclipse ??
From: Sam Pullara <spullara () gmail ! com>
Date: 2014-01-21 22:33:14
Message-ID: 945ED26D-DF57-404D-BC5D-75537C5F77FE () gmail ! com
[Download RAW message or body]
I think this is similar to the same issue with instance fields, you have to fully \
specify them. If you use ReferenceProblem.constant (or in the case of instance \
fields, this.constant) it works. Not sure why the behavior is different.
Sam
On Jan 21, 2014, at 2:23 PM, Remi Forax <forax@univ-mlv.fr> wrote:
> (CC lambda-dev)
> This code do not compile neither with Eclipse nor with javac, but I think that both \
> are wrong.
> public class ReferenceProblem {
> static class A {
> public A(Runnable r) { }
> }
>
> static final A constant = new A(() -> {
> System.out.println(constant);
> });
> }
>
> javac talks about 'self reference' but there is no self reference here, a lambda is \
> a delayed computation. 15.27.2 only concern local variables, so I don't think this \
> code should be rejected.
> cheers,
> Rémi
>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic