|
Last change
on this file since 3127 was 2, checked in by bird, 23 years ago |
|
Initial revision
|
-
Property cvs2svn:cvs-rev
set to
1.1
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
|
|
File size:
708 bytes
|
| Line | |
|---|
| 1 | // This test case once showed that `f[0].execute(x)' woudln't be
|
|---|
| 2 | // expanded properly, attempting to retrieve this$0 to be used in
|
|---|
| 3 | // place of `f[0]'.
|
|---|
| 4 |
|
|---|
| 5 | abstract class A {
|
|---|
| 6 | abstract public void execute(C x);
|
|---|
| 7 | }
|
|---|
| 8 |
|
|---|
| 9 | class C {}
|
|---|
| 10 |
|
|---|
| 11 | class Z extends A {
|
|---|
| 12 | public void execute (C x) {
|
|---|
| 13 | System.out.println ("Z.execute");
|
|---|
| 14 | }
|
|---|
| 15 | }
|
|---|
| 16 |
|
|---|
| 17 | public class invoke_from_inner extends A {
|
|---|
| 18 |
|
|---|
| 19 | Z f[] = new Z[1];
|
|---|
| 20 | class D extends C {
|
|---|
| 21 | D (C x) {
|
|---|
| 22 | f[0].execute (x);
|
|---|
| 23 | execute (x);
|
|---|
| 24 | }
|
|---|
| 25 | }
|
|---|
| 26 | public void execute (C x) {
|
|---|
| 27 | System.out.println ("invoke_from_inner.execute");
|
|---|
| 28 | }
|
|---|
| 29 |
|
|---|
| 30 | public static void main (String a[]) {
|
|---|
| 31 | new invoke_from_inner().foo();
|
|---|
| 32 | }
|
|---|
| 33 | void foo () {
|
|---|
| 34 | f[0] = new Z();
|
|---|
| 35 | new D(new C());
|
|---|
| 36 | }
|
|---|
| 37 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.