this test case is being rejected by javac:

class Test {
    Test(Test t) {}

    Test(String s) {
        this(new Test());
    }

    Test() {}
}

here what is happening is that when analyzing the `new Test()` invocation the 
code to determine if there is an enclosing instance for this expression, javac 
is not checking first if there is an enclosing instance at all. This analysis 
shouldn't be done for cases like the one above for which there is no enclosing 
instance.

TIA

-------------

Commit messages:
 - another change
 - Merge branch 'lworld' into JDK-8379833
 - 8379833: [lworld] Javac is rejecting valid constructor code

Changes: https://git.openjdk.org/valhalla/pull/2231/files
  Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=2231&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8379833
  Stats: 18 lines in 2 files changed: 16 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/valhalla/pull/2231.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/2231/head:pull/2231

PR: https://git.openjdk.org/valhalla/pull/2231

Reply via email to