Debian Codegraph @

src/test/06-Errors/error-depend-spork.ck

raw
1 // error checking: as of 1.5.4.0 dependency tracking
2 // for context-top-level variable where sporked functions
3 // are now verified same as non-sporked function calls
4 //
5 // previously, if sporking, then no dependency check and it's up to
6 // programmer to ensure behavior is as intended
7
8 // spork a function (that depends on foo)
9 spork ~ printArray();
10
11 // initialize foo
12 5 => int foo;
13
14 // function that needs array
15 fun void printArray()
16 {
17 // need 'foo' initialized here
18 if( foo == 5 ) <<< "success" >>>;
19 }
20
21 // give the sporked shred a chance to run
22 me.yield();