mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-30 20:55:33 +08:00
973348ec02
* libjava.lang/PR6204.java, libjava.lang/PR6204.out: New test case. * libjava.lang/PR6085.java, libjava.lang/PR6085.out: Likewise. From-SVN: r52056
39 lines
430 B
Java
39 lines
430 B
Java
class X
|
|
{
|
|
public Y getY()
|
|
{
|
|
return new Y(1);
|
|
}
|
|
}
|
|
|
|
class Y extends X
|
|
{
|
|
int i;
|
|
|
|
Y(int i)
|
|
{
|
|
this.i = i;
|
|
}
|
|
|
|
public Y getY()
|
|
{
|
|
return new Y(2);
|
|
}
|
|
}
|
|
|
|
class A
|
|
{
|
|
X x = new Y(-1);
|
|
public X getX() { return x; }
|
|
}
|
|
|
|
public class PR6204 extends A
|
|
{
|
|
public Y getY() { return super.getX().getY(); }
|
|
|
|
public static void main(String[] args)
|
|
{
|
|
System.out.println (new PR6204().getY().i);
|
|
}
|
|
}
|