﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1729	Flattening error with modelica media type redeclaration of a record	Fritz Zaversky	Fritz Zaversky	"Here the test model: 

%%(color: #000000; font-family: Arial,Helvetica,sans-serif; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 21px; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; background-color: #eeeeee; display: inline ! important; float: none) When I redeclare the record in level two it doesnt work. Following message: Error: Error occurred while flattening model Test.TestModel %% \\%%(color: #000000; font-family: Arial,Helvetica,sans-serif; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 21px; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; background-color: #eeeeee; display: inline ! important; float: none) When I do it on level three it works!   %%

 

package RedeclareRecordTest \\

partial package MyPartialPackageLevelOne  \\

  constant String level = ""LevelOne"";  \\

  replaceable partial record MyRecord \\   //record variable to be defined a level higher \\  end MyRecord;  \\

  \\  replaceable partial model MyReplaceablePartialModelLevelOne  \\

    Real variableOne; \\    Real variableTwo; \\    Real variableThree; \\    Real variableFour;  \\

    MyRecord myRecord;  \\

    equation  \\

     variableThree = 3; \\     variableFour = 4;  \\

  \\  end MyReplaceablePartialModelLevelOne;  \\

end MyPartialPackageLevelOne; \\ \\

partial package MyPartialPackageLevelTwo  \\

  extends MyPartialPackageLevelOne(level = ""LevelTwo"");  \\

  redeclare record extends MyRecord \\    Real recordVariable;  \\  end MyRecord;  \\

end MyPartialPackageLevelTwo; \\ \\

////finally used package  \\

package MyUsedPackage  \\

  extends MyPartialPackageLevelTwo(final level = ""LevelThree"");  \\

/*//this works!  \\  redeclare record extends MyRecord \\    Real recordVariable;  \\  end MyRecord; \\*/ \\  redeclare model extends MyReplaceablePartialModelLevelOne  \\

    equation  \\

     myRecord.recordVariable = variableOne;  \\

  end MyReplaceablePartialModelLevelOne;  \\

end MyUsedPackage;  \\

  \\model TestModel  \\

  package MyPackage = MyUsedPackage;  \\

  MyPackage.MyReplaceablePartialModelLevelOne modelFromPackage;  \\

  equation  \\

    modelFromPackage.variableOne =1; \\    modelFromPackage.variableTwo =2;   \\

end TestModel; 

end RedeclareRecordTest;"	defect	new	high			trunk			Fritz Zaversky
