﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1430	Short class definition causes incorrect redeclared function	Per Östlund	Per Östlund	"The following model:
{{{
partial function part_func
  input Real x;
  output Real y;
end part_func;

function func1
  extends part_func;
algorithm
  y := x;
end func1;

function func2
  extends part_func;
algorithm
  y := 2 * x;
end func2;

model model1
  replaceable function func = part_func;
  Real x;
  Real y;
equation
  x = func(y);
end model1;

model model2 = model1(replaceable function func = func1);
model model3 = model1(replaceable function func = func2);

// This works:
//model model2
//  extends model1(replaceable function func = func1);
//end model2;
//
//model model3
//  extends model1(replaceable function func = func2);
//end model3;

model model4
  model2 m2;
  model3 m3;
end model4;
}}}
flattens to:
{{{
function model1.func
  input Real x;
  output Real y;
algorithm
  y := x;
end model1.func;

class model4
  Real m2.x;
  Real m2.y;
  Real m3.x;
  Real m3.y;
equation
  m2.x = model1.func(m2.y);
  m3.x = model1.func(m3.y);
end model4;
}}}
Only one function is generated, but two different functions are actually used. If model2 and model3 are instead declared like in the commented section above we will get two different functions."	defect	closed	high				fixed		Per Östlund
