Define how/when parameter defaults should be used in dynamic function calls #1281
Labels
Area/Lang
Relates to the Ballerina language specification
Type/Improvement
Enhancement to language design
Description:
The closures generated for default values of function parameters are used at compile-time, when arguments are not specified for such parameters, based on the type descriptor of the declared type of the variable that is used as the function-reference. The runtime type descriptor (and parameter defaults and closures) of the referenced function value is not used here (Function call expression).
But, in certain scenarios, default values may also have to be computed at runtime using the closures from the type descriptor of the function value.
function:call
In jBallerina, the default value closures are used in both these cases to compute the arguments for defaultable parameters when arguments are not passed for such a parameter.
Related issues/discussions:
The text was updated successfully, but these errors were encountered: