Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#5253 closed defect (fixed)

No error for unknown array size in non-inputs in functions

Reported by: Zimon Kuhs Owned by: Jesper Mattsson
Priority: major Milestone:
Component: Modelica/FrontEnd Version: trunk
Keywords: Cc:


E.g. for

package P
function f
  input Integer n;
  input Integer v[:];
  Integer x[n];
  Integer y[:];
  Integer z[2];
  output Integer o;
  o := v[1] + x[1] + y[1] + z[1];
  x := fill(-1, 2);
  y := ones(o);
  z := zeros(2);
end f;

model M
  Integer x = f(2, {2, 2});
end M;

model M2
  input Integer n;
  input Real a[:];
  Real b[:];
  output Real c[:];
  b[:] = fill (n, size(a, 1));
  c = a;
end M2;
end P;

Change History (2)

comment:1 Changed 3 years ago by Zimon Kuhs

Resolution: fixed
Status: newclosed


Added error for declaration of non-input arrays in functions.

comment:2 Changed 3 years ago by Jonathan Kämpe


Reworked error check introduced in r9549 to be a bit nicer

Note: See TracTickets for help on using tickets.