src/test/01-Basic/110.ck
raw| 1 | // static test: sporking a static function without dot notation |
| 2 | // e.g., foo(...) rather than f.foo(...) or Foo.foo(...) |
| 3 | // note this can only happen from within another function of |
| 4 | // the same class or a child class. |
| 5 | |
| 6 | class Foo |
| 7 | { |
| 8 | fun static void start() |
| 9 | { |
| 10 | spork ~ foo( "bar" ); |
| 11 | me.yield(); |
| 12 | } |
| 13 | |
| 14 | fun static void foo( string s ) |
| 15 | { |
| 16 | if( s == "bar" ) <<< "success" >>>; |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | Foo.start(); |