[chuck-users] Cannot assign array of Oscs to UGen[]
Karim Sumun
sumun at pobox.com
Wed Jan 4 09:59:15 EST 2017
Given the following declarations:
SinOsc s0;
SqrOsc s1;
TriOsc s2;
The following gives an error:
[s0, s1, s2] @=> UGen A[];
$ ... cannot resolve operator '=>' on types 'Osc[]' and 'UGen[]'...
But the following works fine:
[s0, s1, s2] @=> Osc A[];
It is not a problem, but would like to understand this behaviour. It would
seem that assigning to UGen[] would be ok because it looks like a
superclass of Osc[].
Aaah! Is this to do with co/contra-variance?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20170104/a4e4e95c/attachment.html>
More information about the chuck-users
mailing list