Opened 9 years ago

Closed 3 years ago

#3450 closed defect (fixed)

Cyclically dependent parameter error in replaceable function

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;

Attachments (1)

CTest.mo (1.8 KB ) - added by Markus Dahl 9 years ago.
Package file needed to reproduce the error

Download all attachments as: .zip

Change History (9)

by Markus Dahl, 9 years ago

Attachment: CTest.mo added

Package file needed to reproduce the error

comment:1 by Adrian Pop, 9 years ago

I guess this is a duplicate of #3368.

comment:2 by Markus Dahl, 9 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, 9 years ago

Description: modified (diff)

comment:4 by Henrik Tidefelt, 9 years ago

Description: modified (diff)

comment:5 by Henrik Tidefelt, 9 years ago

Description: modified (diff)

comment:6 by Henrik Tidefelt, 9 years ago

Description: modified (diff)

comment:7 by Henrik Tidefelt, 9 years ago

Summary: Cyclic dependant parameter error in replaceable functionCyclically dependent parameter error in replaceable function

comment:8 by Per Östlund, 3 years ago

Component: FrontendNew Instantiation
Milestone: Future1.19.0
Resolution: fixed
Status: newclosed

This has been working with the new frontend since probably a long time, but I added a test case for it in 517b9a7b (which fixes #3368) to make sure it stays that way.

Note: See TracTickets for help on using tickets.