chuck icon indicating copy to clipboard operation
chuck copied to clipboard

error when declaring an array of floats whose 1st element is an int

Open mariobuoninfante opened this issue 4 years ago • 1 comments

MacOS High Sierra 10.13.1 - ChucK 1.4.0.0

When declaring an array of floats the following way:

[1,2.] @=> float a[]; // same result using [1,2] - that has no floats at all in the array

I get the following error:

line(1): array init [...] contains incompatible types...

While declaring it this way instead is fine:

[1.,2] @=> float a[];

mariobuoninfante avatar Dec 02 '19 22:12 mariobuoninfante

I think this has been a known issue for a really long time. Not sure whether it would be easy to fix. Most people just make sure that the first number is a float, I think...

lathertonj avatar Dec 02 '19 22:12 lathertonj