Opened 14 years ago

Last modified 14 years ago

#1432 closed defect (fixed)

Short class definition with redeclared function fails with no error message

Reported by: Per Östlund Owned by: Per Östlund
Priority: high Milestone:
Component: Version:
Keywords: Cc: Per Östlund,

Description

The following model fails with no error message:

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 = model2(replaceable function func = func2);

model model4
  model2 m2;
  model3 m3;
end model4;

This bug might be related to bug #1430. The model is almost the same, the only difference is that model3 extends from model2 instead of model1. I'm not 100% certain that this type of model is allowed, but regardless of whether it's allowed or not it shouldn't fail without an error message.

Change History (1)

comment:1 by Adrian Pop, 14 years ago

now the model actually works as expected.

Note: See TracTickets for help on using tickets.