Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#5011 closed defect (fixed)

The scalar() function is sometimes not flattened by the NF

Reported by: Francesco Casella Owned by: Per Östlund
Priority: high Milestone: 2.0.0
Component: New Instantiation Version:
Keywords: Cc:

Description

Please consider the following test case:

model TestScalar
  function f
    input Real u[:];
    output Real y = n;
  protected
    Integer n = scalar(size(u)) - 1;
    annotation(Inline=false);
  end f;
  Real x[1] = {1};
  Real y = f(x);
end TestScalar;

the flattened code contains

function TestScalar.f
  input Real[:] u;
  output Real y = /*Real*/(n);
  protected Integer n = scalar(size(u)) - 1;
end TestScalar.f;

which later breaks the code generation because scalar() is undefined.

This issue affects Modelica.Media.Examples.R134a.R134a2.

Change History (2)

comment:1 by Per Östlund, 7 years ago

Resolution: fixed
Status: newclosed

Fixed in 40db59ee.

comment:2 by Francesco Casella, 7 years ago

At 47 minutes, this was the fastest fix ever :)

Note: See TracTickets for help on using tickets.