I want to pass an optional array parameter to a function. If the parameter is not specified, the array must be empty. I tried the following:
<cfargument name="time_blocks" type="array" required="false" default="[]">
But I get the following error:
invalid call of the function CreateRateBlock 14th Argument (time_blocks) is of invalid type, can't cast String [] to a value of type [array]
I also tried this:
<cfargument name="time_blocks" type="array" required="false" default="">
In this case, the error is almost the same:
invalid call of the function CreateRateBlock 14th Argument (time_blocks) is of invalid type, can't cast String [] to a value of type [array]
I also tried removing the default attribute, but in this case the time_blocks value is null. What am I doing wrong?
source share