We're updating the issue view to help you get more done. 

Passing positional args to task errors with required param

Description

This tasl:

1 2 3 4 5 6 7 component { function run( required numeric id ) { print.greenLine( id ); } }

works when called with named args:

1 task run taskFile=task target=run :id=5

But errors when called with positional args

1 task run task run 5
1 2 3 4 5 6 7 8 Can't cast Object type [Array] to a value of type [Struct] Java type of the object is lucee.runtime.type.ArrayImpl C:\Users\JP\.CommandBox\cfml\system\services\CommandService.cfc: line 972 970: for( var param in commandParams ){ 971: // If it's required and hasn't been supplied... 972: if( param.required && !structKeyExists( userNamedParams, param.name ) ){ 973: // ... Ask the user 974: var message = 'Enter #param.name# ';

Status

Assignee

Brad Wood

Reporter

Brad Wood

Labels

None

Fix versions

Affects versions

4.3.0

Priority

Major