Compiler error COLLECTION TO ARRAY

Hi,

I am getting a “Missing parameters” error in the compiler on the “COLLECTION TO ARRAY” line in code like this in an app.

C_COLLECTION($xxc)
C_TEXT($xxT)
ARRAY TEXT($xxa;0)
COLLECTION TO ARRAY($xxc;$xxa;$xxT) // seems like this should pass the compiler check as written…

It works fine in interpreted mode, but fails to compile. COLLECTION TO ARRAY works elsewhere in the app, but in those instances a literal string like “id” appears in the $xxT place.

Does this sound like a bug, or am I not seeing something obvious?

v17.134462 64-bit

Thanks,

could it be that $xxT is somehow considered “unused local variable” by the compiler?

The method it is in does not show up in the list of methods with unused local variables.
… and the variable is not in any methods in the list.

Seems the compiler is confused and doesn’t treat $xxT as a string. As a workaround, you can use

COLLECTION TO ARRAY($xxc;$xxa;String($xxT))

That will make the compiler happy and should work. Haven’t tested though.

Michael

Great idea. Sending the variable through the String function allows the app to compile.

Thanks