﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
5011	The scalar() function is sometimes not flattened by the NF	Francesco Casella	Per Östlund	"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 [https://libraries.openmodelica.org/branches/newInst/Modelica_trunk/files/Modelica_trunk_Modelica.Media.Examples.R134a.R134a2.err Modelica.Media.Examples.R134a.R134a2]."	defect	closed	high	2.0.0	New Instantiation		fixed		
