src/test/06-Errors/error-class-def-order.ck
raw| 1 | // error case: out of order class definitions; Y extends X, but |
| 2 | // Y is defined ahead of X; certain definitions can appear after |
| 3 | // usage or invocation, but for now this is not permitted |
| 4 | |
| 5 | |
| 6 | // define Y |
| 7 | class Y extends X |
| 8 | { |
| 9 | public void foo() { } |
| 10 | } |
| 11 | |
| 12 | // define X |
| 13 | class X |
| 14 | { |
| 15 | public void foo() { } |
| 16 | int y; |
| 17 | dur z; |
| 18 | } |
| 19 | |
| 20 | // instantiate a X |
| 21 | X x; |
| 22 | |
| 23 | // instantiate a Y |
| 24 | Y y; |
| 25 | |
| 26 | // shouldn't get here... |
| 27 | <<<"shouldn't get here...">>>; |