'all from' clause ignored in template initialized with function call
Submitted by Botond Baranyi
Link to original bug (#502442)
Description
When initializing a template with a function call that has parameters, and a template containing an 'all from' clause is passed to one of these templates, then the 'all from' clause is ignored, and the function only receives the rest of the template (as if the 'all from' clause wasn't there).
This only happens for global template initializations with a function call. Template variables initialized in the same way work as intended, and so does calling the function directly.
Example: module test {
type record of integer RoI;
function f_roi(template RoI p) return template RoI { return p; }
template RoI t := { 6, 8 };
template RoI t_roi := f_roi( { 1, 2, all from t } );
control { var template RoI vt_roi := f_roi( { 1, 2, all from t } ); action(t_roi); // bad: { 1, 2 } action(f_roi({ 1, 2, all from t } )); // good: { 1, 2, 6, 8 } action(vt_roi); // good: { 1, 2, 6, 8 } }
}
Version: 5.5.0