src/test/01-Basic/184-return-ctrl-paths-4.ck
raw| 1 | // pass case: slightly more complex |
| 2 | // thanks @phlub on ChucK Community Discord Server |
| 3 | |
| 4 | class Foo |
| 5 | { |
| 6 | int chord[]; |
| 7 | int trailingNotes[]; |
| 8 | |
| 9 | fun static Foo make( int c[], int t[]) |
| 10 | { |
| 11 | Foo a; |
| 12 | c @=> a.chord; |
| 13 | t @=> a.trailingNotes; |
| 14 | return a; |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | // success condition |
| 19 | if( Foo.make([1,2],[3,4]).chord[1] == 2 ) |
| 20 | <<< "success" >>>; |