Problem with ?: operator and vectors

Found a bug? Post information about it here so we can fix it!

Moderator: Moderators

Post Reply
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Problem with ?: operator and vectors

Post by Rado1 »

If ternary conditional operator ( ?: ) is used for assignment to a vector variable, ZGE reports "Identifier is not an array:" syntax error.

Code: Select all

// works correctly
RenderSetColorA.Color = vector3(0, 0, 1);

// throws "Identifier is not an array:" syntax error
RenderSetColorA.Color = 1 ? vector3(1, 0, 0) : vector3(0, 0, 1);
There is maybe some incorrect type inference for ?: operator in parser (?). This is not a big problem, because if-then-else statement can be used instead... but would be nice to have this option in scripting language.
Post Reply