﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1090	Code generation of identity() fails in a function .	rruusu	rruusu	"The model below produces an internal error:
{{{
function returnArray
  output Real[3,3] o;
algorithm
  o := identity(3);
end returnArray;

model Test
  Real[3,3] array;
equation
  array = returnArray();
end Test;
}}}

Result of omc +s:
{{{
fclass Test
Real array[1,1];
Real array[1,2];
Real array[1,3];
Real array[2,1];
Real array[2,2];
Real array[2,3];
Real array[3,1];
Real array[3,2];
Real array[3,3];
equation
  array = returnArray();
end Test;
Error processing file: ArrayFunctionTest4.mo
Internal error code  generation of expression CAST(/tp:REAL[3, 3]/, identity(3))
 failed
Internal error Code generation of Modelica functions failed.

# Error encountered! Exiting...
# Please check the error message and the flags.

Execution failed!
}}}

There is no problem when {{identity}} is used in an equation. The error does not occur if {{identity(3)}} is replaced with {{zeros(3,3)}}."	defect	closed	high				fixed		rruusu
