src/test/06-Errors/error-depend-var.ck
raw| 1 | // dependency tracking for context-top-level variable |
| 2 | |
| 3 | // does not work here, since it precedes 'bar' initialization |
| 4 | foo(); |
| 5 | |
| 6 | // where 'bar' initializes |
| 7 | 5 => int bar; |
| 8 | |
| 9 | // FYI calling foo() works here because it's after 'bar' initializes |
| 10 | // foo(); |
| 11 | |
| 12 | // the function definition |
| 13 | fun void foo() |
| 14 | { |
| 15 | // needs 'bar' to be initialized |
| 16 | <<< "bar:", bar >>>; |
| 17 | } |