src/test/01-Basic/188-class-var-anywhere1.ck
raw| 1 | // verifying accessing member declared below where it's used |
| 2 | |
| 3 | // instance of Foo |
| 4 | Foo foo; |
| 5 | // using val above declaration should be ok |
| 6 | 5 => foo.val; |
| 7 | |
| 8 | // this should be good too |
| 9 | 8 => Foo.sval; |
| 10 | |
| 11 | class Foo |
| 12 | { |
| 13 | int val; |
| 14 | static int sval; |
| 15 | } |
| 16 | |
| 17 | // success if no errors |
| 18 | <<< "success" >>>; |