test/langtools/tools/javac/FlatnameClash2.java
author darcy
Fri, 02 Feb 2018 10:29:25 -0800
changeset 48723 6cb86bf0b51e
parent 47216 71c04702a3d5
permissions -rw-r--r--
8196623: Update JavaBaseTest.java to be version agnostic Reviewed-by: vromero
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
}