Opened 10 years ago

Last modified 3 years ago

#3450 closed defect

Cyclic dependant parameter error in replaceable function — at Version 5

Reported by: Markus Dahl Owned by: somebody
Priority: high Milestone: 1.19.0
Component: New Instantiation Version:
Keywords: Cc:

Description (last modified by Henrik Tidefelt)

Validation of P.M in the package below yields the following error in the message browser (but also reports the validation as successful):

Error: Cyclically dependent constants or parameters found in scope : {x}.

In the Base model, changing the modifier x=x in the redeclaration of the function to x=5 will resolve the error. However those two statements should be equivalent.

Package:

package P

  function f
    input Real x;
    output Real y;
  algorithm
    y := x + 2;
  end f;

  partial model Base
    replaceable partial function func = f;
  end Base;

  model M
    extends Base(redeclare final function func = f(x = x));
    parameter Real x = 5;
    Real y = func(1);
  end M;

end P;

Change History (6)

by Markus Dahl, 10 years ago

Attachment: CTest.mo added

Package file needed to reproduce the error

comment:1 by Adrian Pop, 10 years ago

I guess this is a duplicate of #3368.

comment:2 by Markus Dahl, 10 years ago

The error message generated from the ExampleModel in CTest.mo is not the same as in ticket #3368. CTest also succesfully validates while #3368 does not. However the tickets are very similar.

comment:3 by Henrik Tidefelt, 10 years ago

Description: modified (diff)

comment:4 by Henrik Tidefelt, 10 years ago

Description: modified (diff)

comment:5 by Henrik Tidefelt, 10 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.