langtools/test/tools/javac/FlatnameClash2.java
author jlahoda
Tue, 16 Aug 2016 16:43:00 +0200
changeset 40504 0a01f6710c84
parent 26528 a1a7ad15183e
permissions -rw-r--r--
8078561: Error message should be generated once when -source 6 is specified Summary: Code to avoid duplicated errors about features not supported in the current source level moved to Log Reviewed-by: jjg

/*
 * @test /nodynamiccopyright/
 * @bug 4629327
 * @summary Compiler crash on explicit use of synthetic name for inner class.
 * @author Neal Gafter
 *
 * @compile/fail/ref=FlatnameClash2.out -XDrawDiagnostics FlatnameClash2.java
 */

package tests;

class T1 {
    public void print(Inner1 inf) {
        inf.print();
    }

    public class Inner1 {
        public void print() {
            System.out.println("Inner1");
        }

    }
}


class T2 extends T1 {
    public void print() {
        super.print(new Inner2());
    }

    private class Inner2
        extends tests.T1$Inner1 // ERROR: name not found
    {
        public void print() {
            System.out.println("Inner2");
        }
    }
}