Debian Codegraph @

src/test/01-Basic/275-func-var-decl.ck

raw
1 // test functions that access variables declared after the function
2 // definition; this is (correctly) not caught by the dependency
3 // system, which assumes function defs to be order independent
4 //
5 // this was an issue that was fixed in 1.5.4.4
6 // https://github.com/ccrma/chuck/issues/482
7
8 // func def
9 fun void foo()
10 {
11 // access vars
12 <<< bar, boo >>>;
13 // write to a var
14 3 => boo;
15 }
16
17 // the vars
18 1 => int bar;
19 2 => int boo;
20
21 // call the function
22 foo();
23
24 // print after function call
25 <<< bar, boo >>>;