langtools/test/tools/javac/FlatnameClash2.java
author lana
Thu, 21 Jan 2016 09:46:01 -0800
changeset 35340 38f7386ed942
parent 26528 a1a7ad15183e
permissions -rw-r--r--
Added tag jdk-9+102 for changeset 7e3feb2ba5b3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
26528
a1a7ad15183e 8055075: Group 9b: golden files for tests in tools/javac dir
sogoel
parents: 5520
diff changeset
     2
 * @test /nodynamiccopyright/
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * @bug 4629327
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 * @summary Compiler crash on explicit use of synthetic name for inner class.
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * @author Neal Gafter
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 *
26528
a1a7ad15183e 8055075: Group 9b: golden files for tests in tools/javac dir
sogoel
parents: 5520
diff changeset
     7
 * @compile/fail/ref=FlatnameClash2.out -XDrawDiagnostics FlatnameClash2.java
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
package tests;
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
class T1 {
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
    public void print(Inner1 inf) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
        inf.print();
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
    public class Inner1 {
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
        public void print() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
            System.out.println("Inner1");
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
    21
06bc494ca11e Initial load
duke
parents:
diff changeset
    22
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    23
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
class T2 extends T1 {
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
    public void print() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
        super.print(new Inner2());
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
    private class Inner2
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
        extends tests.T1$Inner1 // ERROR: name not found
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
    {
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
        public void print() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
            System.out.println("Inner2");
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
}