﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3409	Wrong array concatenation with zeros operator	Rüdiger Franke	somebody	"This case is motivated by `Modelica.Mechanics.MultiBody.Visualizers.Colors.ColorMaps.jet` which is used by `Modelica.Mechanics.MultiBody.Examples.Elementary.Surfaces`. Interestingly the MSL test validates nevertheless in the C runtime.
{{{#!mo
package ArrayConcat
  function f
    input Real v[:];
    output Real m[size(v, 1), 2];
  algorithm
     m := [zeros(size(v, 1)), v];
  end f;

  model Test
    Real m[:,:] = f({0.1, 0.2, 0.3});
  end Test;
end ArrayConcat;
}}}
OpenModelica builds an Integer array (maybe motivated by the zeros), fills it with the Real vector v (the values are corrupted) and then casts the Integer array to a Real array:
{{{
setCommandLineOptions(""+d=nogen,initialization"");
loadFile(""ArrayConcat.mo"");
simulate(ArrayConcat.Test);
val(m[1,2], 1);
val(m[2,2], 1);
val(m[3,2], 1);
}}}
gives with the C runtime:
{{{
4.591870180066958e+18
4.596373779694328e+18
4.599075939470751e+18
}}}
The Cpp runtime fails to compile the model due to type mismatch in the SCode.
"	defect	closed	high	1.9.4	Frontend	trunk	fixed		Niklas Worschech
