Debian Codegraph @

src/test/01-Basic/108.ck

raw
1 // static test: calling 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 foo( "bar" );
11 }
12
13 fun static void foo( string s )
14 {
15 if( s == "bar" ) <<< "success" >>>;
16 }
17 }
18
19 Foo.start();