Debian Codegraph @

src/test/01-Basic/271-ctor-call-ctor.ck

raw
1 class Foo
2 {
3 int theX;
4
5 // a constructor
6 fun Foo( int x ) { x => theX; }
7
8 // another constructor
9 fun Foo()
10 {
11 // call a specific constructor
12 Foo( 5 );
13 }
14 }
15
16 // make a foo
17 Foo foo;
18
19 // check
20 if( foo.theX == 5 ) <<< "success" >>>;
21