﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3450	Cyclic dependant parameter error in replaceable function	Markus Dahl	somebody	"Running the ExampleModel from the package below will yield the following error:

  15:55:39 Translation Error
  [CTest: 9:47-9:80]: Cykliskt beroende konstanter eller parametrar hittades i definitionsomr�de : {x}.

or translated to english..

   Error: Cyclically dependent constants or parameters found in scope : {x}.

In the ambient 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 CTest

  model ExampleModel
    Component component;
    inner Ambient ambient;
  end ExampleModel;

  model Ambient
    extends CTest.AmbientBase(redeclare final function func = CTest.func(x = x));
    parameter Real x = 5;
  end Ambient;

  partial model AmbientBase
    replaceable partial function func = CTest.func;
    parameter Real var_value = 2;
  end AmbientBase;

  model Component
    outer Ambient ambient;
    parameter Real var = ambient.func(ambient.var_value);
    Real z;
  equation
    z = var;
  end Component;

  function func
    input Real x;
    output Real y;
  algorithm
    y := x + 2;
  end func;

end CTest;
}}}
"	defect	new	high	Future	Frontend				
