Debian Codegraph @

src/test/01-Basic/181-return-ctrl-paths-1.ck

raw
1 // all control paths return
2
3 fun float foo( int v )
4 {
5 if( v == 1 )
6 {
7 return 1;
8 }
9 else if( v == 2 )
10 {
11 return 2;
12 }
13 else
14 {
15 return 3;
16 }
17 }
18
19 // success case
20 if( Math.equal(foo(1)+foo(2)+foo(3), 6) )
21 <<< "success" >>>;