Opened 9 years ago

#3563 new defect

Functional input arguments ignore default arguments

Reported by: Per Östlund Owned by: somebody
Priority: normal Milestone: Future
Component: Frontend Version:
Keywords: Cc:

Description

The following model doesn't work, because the type checking ignores the default argument on f2.y.

function f1
  input Real x;
  input PF pf;
  output Real y = pf(x);

  partial function PF
    input Real x;
    output Real y;
  end PF;
end f1;

function f2
  input Real x;
  input Real y = 2.0;
  output Real z = x + y;
end f2;

model test
  Real x = f1(3.0, f2); // Error: (Real, Real) => Real != Real => Real
end test;

This is annoying when writing MetaModelica code and using e.g. List.fold with a function that has default arguments.

Change History (0)

Note: See TracTickets for help on using tickets.