langtools/test/tools/javac/staticImport/Shadow.java
author sogoel
Tue, 27 Jan 2015 15:11:57 -0800
changeset 28705 675cb37e74a8
parent 5520 86e4b9a9da40
permissions -rw-r--r--
8068463: Group 10c: golden files for tests in tools/javac dir Reviewed-by: jjg, mcimadamore
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
28705
675cb37e74a8 8068463: Group 10c: 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 5017254
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 * @summary compiler fails to shadow inapplicable method with static import
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * @author gafter
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 *
28705
675cb37e74a8 8068463: Group 10c: golden files for tests in tools/javac dir
sogoel
parents: 5520
diff changeset
     7
 * @compile/fail/ref=Shadow.out -XDrawDiagnostics   Shadow.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 shadow;
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
import static shadow.T1.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
import static shadow.T2.m1;
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
class T1 {
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
    public static void m1() {}
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
class T2 {
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
    public static void m1(int i) {}
06bc494ca11e Initial load
duke
parents:
diff changeset
    21
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    22
06bc494ca11e Initial load
duke
parents:
diff changeset
    23
class Test {
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
    void foo() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
        m1(); // <-- is this an error?
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
}