﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3419	Function signatures for type safe function partial application	Rüdiger Franke	Lennart Ochel	"OpenModelica boxes arguments of functions that are passed as input to other functions. The actual types of the arguments appear to be only known during the boxing/unboxing operations. This hinders the generation of type safe code. The actual function signatures should be accessible from `PARTEVALFUNCTION` and `FUNCTION_PTR` (see SimCodeTV.mo).

See the following example:

{{{#!mo
partial function part
  input Real u;
  output Real y;
end part;

function func
  extends part;
  input Real v;
algorithm
  y := u + v;
end func;

function feval
  input part f;
  output Real y;
algorithm
  y := f(1);
end feval;

model m
  Real y = feval(function func(v = 2));
end m;
}}}

When generating code for `function feval`, the signature of the input `part` should be accessible from the `FUNCTION_PTR` argument.

When generating code for `model m`, the signatures of the used function `func` and of the expected `part` should be accessible from `PARTEVALFUNC`.

So far only the types of the additional arguments of `func` (v in the example) can be derived from the `expList` contained in `PARTEVALFUNC`. "	defect	new	high	Future	Code Generation	trunk			
