src/test/01-Basic/172-depend-spork.ck.disabled
raw| 1 | // dependency tracking for context-top-level variable |
| 2 | // if sporking, then no dependency check and it's up to |
| 3 | // programmer to ensure behavior is as intended |
| 4 | |
| 5 | // works here, due to spork |
| 6 | spork ~ printArray(); |
| 7 | |
| 8 | // initialize foo |
| 9 | 5 => int foo; |
| 10 | |
| 11 | // function that needs array |
| 12 | fun void printArray() |
| 13 | { |
| 14 | // need 'foo' initialized here |
| 15 | if( foo == 5 ) <<< "success" >>>; |
| 16 | } |
| 17 | |
| 18 | // give the sporked shred a chance to run |
| 19 | me.yield(); |