Hi

This code produce a crash on linux with chuck-alsa. Maybe the "logic" is not right but the crash exist.


class Foo {}

fun void appendCap( Foo arr[], int n ) {
    Foo @ aux[ arr.cap() + n ];

    for( int i; i < arr.cap(); i++ ) {
        arr[i] @=> aux[i];
    }

    aux @=> arr;
}

Foo @ vars[5];
for( int i; i < vars.cap(); i++ ) <<< vars[i] >>>;

appendCap( vars, 5 );
//<<< vars[4] >>>;
<<< vars.cap() >>>;

<<< "End" >>>;

/* this work fine
fun Foo[] append( Foo arr[], int n ) {
    Foo @ aux[ arr.cap() + n ];

    for( int i; i < arr.cap(); i++ ) {
        arr[i] @=> aux[i];
    }

    return aux;
}
*/


Yours
Lucas