﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3687	Inline module fails with protected array variables	Willi Braun	Willi Braun	"Following model results into code generation issue, because of protected array variables:
{{{#!modelica
model foo
  function f
    input Real z;
    output Real y;
  protected
    Real a[2];
  algorithm
    a := {2 * z, z};
    y := sum(a);
    annotation(Inline = true);
  end f;

  Real y(start = 0, fixed = true);
  Real z;
equation
  z = f(5 + time);
  der(y) = z;
end foo;
}}}
Even worse is the following example:
{{{#!modelica
model foo
  function f
    input Real z;
    output Real y;
  protected
    Real a[2];
  algorithm
    a := {2 * z, z};
    y := sum(a)/3;
    annotation(Inline = true);
  end f;
  function f1
    input Real z;
    output Real y;
  protected
    Real a[2];
  algorithm
    a := {2 * z, z};
    y := sum(a)/3;
  end f1;

  Real y(start = 0, fixed = true);
  Real z, z2, w;
  Real a[2] = {sin(time),cos(time)};
equation
  z = f(5 + time);
  z2 = f1(5 + time);
  der(y) = z;
end foo;
}}}
that results into really wrong outcome for z compared to z2."	defect	new	blocker	Future	Backend	v1.9.4-dev-nightly			Vitalij Ruge
