Debian Codegraph @

src/test/06-Errors/error-func-ambiguous.ck

raw
1 // test that when calling overloaded function, it calls the one
2 // with the "closer" signature, as determine by distance to parent
3 // types; in this case, SinOsc is "closer" to UGen than to Object
4
5 fun void foo( Object a, UGen b )
6 {
7 <<< 1 >>>;
8 }
9
10 fun void foo( UGen a, Object b )
11 {
12 <<< 2 >>>;
13 }
14
15 // a SinOsc which is an UGen, which in turn is an Object
16 SinOsc bar;
17
18 // which to call?
19 foo( bar, bar );
20