src/test/01-Basic/111.ck
raw| 1 | // static function test: sporking a static function defined in a |
| 2 | // parent class, without using the dot notation |
| 3 | |
| 4 | class FooParent |
| 5 | { |
| 6 | fun static void foo( string s ) |
| 7 | { |
| 8 | if( s == "bar" ) <<< "success" >>>; |
| 9 | } |
| 10 | } |
| 11 | |
| 12 | class Foo extends FooParent |
| 13 | { |
| 14 | fun static void start() |
| 15 | { |
| 16 | // spork without dot notation e.g., f.foo(...) |
| 17 | spork ~ foo( "bar" ); |
| 18 | // yield to let new shred run |
| 19 | me.yield(); |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | Foo.start(); |