Float array doesn't cast integers given in default value

This doesn’t work

open float pos[]
{
name = 'pos'
descr = 'pos'
value = [4, 6, -4, -2, 0, 2]
}

It ends up with the following error:
assignment of array with wrong data type

The assignment of arrays type is handled in two ways:

  • by explicit stating the type in front of the array in pointy brackets (<float>)
  • or by observing the data type of the first element

Here, this method leads to an array over integers, what is not the expected data type of the open paramater. It can be fixed by choosing the first of the two given methods:

open float pos[]
{
name = 'pos'
descr = 'pos'
value = <float>[4, 6, -4, -2, 0, 2]
}
1 Like