langtools/test/tools/javac/T6977800.java
author mcimadamore
Thu, 19 Aug 2010 11:54:25 +0100
changeset 6352 217d5a69681a
permissions -rw-r--r--
6977800: Regression: invalid resolution of supertype for local class Summary: resolution of superclass/superinterfaces in extends/implements clause skips local classes Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6352
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
     1
/*
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
     2
 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
     4
 *
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
     7
 * published by the Free Software Foundation.
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
     8
 *
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    13
 * accompanied this code).
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    14
 *
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    18
 *
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    21
 * questions.
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    22
 */
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    23
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    24
/*
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    25
 * @test
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    26
 * @bug 6977800
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    27
 * @summary Regression: invalid resolution of supertype for local class
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    28
 * @compile T6977800.java
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    29
 */
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    30
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    31
class T6977800 {
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    32
    public static void test() {
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    33
        class A {
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    34
            int x = 1;
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    35
        }
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    36
        class B extends A {}
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    37
        System.out.println(new B().x);
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    38
    }
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    39
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    40
    static class A {}
217d5a69681a 6977800: Regression: invalid resolution of supertype for local class
mcimadamore
parents:
diff changeset
    41
}