﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3189	Partial function evaluation and arrays not working	Gustaf Thorslund	somebody	"Consider the following example similar to the function passed to function in #3008, but here the return type is an array instead of two values.

{{{
package TestArrayP
  partial function DerBase
    input Real x[:];
    output Real dx[size(x)];
  end DerBase;

  function TheDer
    extends DerBase;
    input Real x[:];
    output Real dx[size(x)];
  algorithm
    dx := 0.1 * x;
  end TheDer;

  function Euler
    input Real x[:];
    input DerBase f;
    input Real dt;
    output Real xNext[size(x)];
  protected
    Real dx[size(x)];
  algorithm
    dx := f(x);
    xNext := x + dx * dt;
  end Euler;
end TestArrayP;

model TestArray
  Real x[2] = {1.0, 2.0};
algorithm
  x[1] := 1.0;
  x[2] := 2.0;
  when sample (0, 0.1) then
    x := TestArrayP.Euler(x, TestArrayP.TheDer, 0.1);
  end when;
end TestArray;
}}}

Trying to compile it gives
{{{
$ omc -s TestArray.mo
Error processing file: TestArray.mo
[.../TestArray.mo:23:5-23:15:writable] Error: Type mismatch in assignment in dx := f(#(x)) of Real[size(x)] := #Real[size(x)]
Error: Error occurred while flattening model TestArray

# Error encountered! Exiting...
# Please check the error message and the flags.

Execution failed!
}}}

$ omc --version
1.9.2+dev (r24700)

"	defect	closed	high	1.16.0	New Instantiation	trunk	fixed		
