﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
2889	Function pointers loose their default values	Per Östlund	Martin Sjölund	"Evaluating the test function below causes a segfault:
{{{#!mo
function FuncID11<IT1, OT1>
  input FuncType inFunc;
  output FuncType outFunc := inFunc;

  partial function FuncType
    input IT1 inArg1;
    output OT1 outArg1;
  end FuncType;
end FuncID11;

function f1
  input Real x;
  input Real y;
  output Real z := x + y;
end f1;

function test
  partial function pf
    input Real x;
    output Real z;
  end pf;

  output Real x;
protected
  pf mypf;
algorithm
  mypf := FuncID11(function f1(y = 3));
  x := mypf(2);
end test;
}}}
The reason is that outFunc in FuncID11 becomes a SimCode.FUNCTION_PTR, which doesn't have a field to store the default value in. A workaround in this case is to do the assignment in an algorithm section, but this obviously doesn't work for input default arguments."	defect	closed	normal	1.9.1	MetaModelica	trunk	fixed		
