Changes between Version 4 and Version 5 of Ticket #3450
- Timestamp:
- 2015-09-10T06:46:08Z (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #3450 – Description
v4 v5 1 Running the ExampleModel from the package below will yield the following error: 2 3 15:55:39 Translation Error 4 [CTest: 9:47-9:80]: Cykliskt beroende konstanter eller parametrar hittades i definitionsomr�de : {x}. 5 6 or translated to english.. 1 Validation of `P.M` in the package below yields the following error in the message browser (but also reports the validation as successful): 7 2 8 3 Error: Cyclically dependent constants or parameters found in scope : {x}. 9 4 10 In the ambientmodel, 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.5 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. 11 6 12 7 Package: 13 8 {{{ 14 package CTest9 package P 15 10 16 model ExampleModel 17 Component component; 18 inner Ambient ambient; 19 end ExampleModel; 20 21 model Ambient 22 extends CTest.AmbientBase(redeclare final function func = CTest.func(x = x)); 23 parameter Real x = 5; 24 end Ambient; 25 26 partial model AmbientBase 27 replaceable partial function func = CTest.func; 28 parameter Real var_value = 2; 29 end AmbientBase; 30 31 model Component 32 outer Ambient ambient; 33 parameter Real var = ambient.func(ambient.var_value); 34 Real z; 35 equation 36 z = var; 37 end Component; 38 39 function func 11 function f 40 12 input Real x; 41 13 output Real y; 42 14 algorithm 43 15 y := x + 2; 44 end f unc;16 end f; 45 17 46 end CTest; 18 partial model Base 19 replaceable partial function func = f; 20 end Base; 21 22 model M 23 extends Base(redeclare final function func = f(x = x)); 24 parameter Real x = 5; 25 Real y = func(1); 26 end M; 27 28 end P; 47 29 }}}