Opened 14 years ago

Last modified 14 years ago

#1253 closed defect (fixed)

Backend: Enumerations don't produce correct start value in init file

Reported by: Martin Sjölund Owned by: Martin Sjölund
Priority: high Milestone:
Component: Instantiation Version: 1.6.0
Keywords: Cc: Martin Sjölund,

Description

{{{class A
type E = enumeration(a,b);
E e(start = E.b) = E.a;
end A;}}}

To fix:
DAEUtil.getStartAttrFail needs to be able to return start value for enum
SimCode.printExpStrOpt needs to print the index if the constant is an enum

Easiest to fix after Per commits his other enum fixes

Change History (2)

comment:1 by Pavol Privitzer, 14 years ago

This issue will be solved when init file is generated from templates using SIMVAR.initialValue and addition of:

case (SOME(DAE.VAR_ATTR_ENUMERATION(start = SOME(r)))) then r;

to DAEUtil.getStartAttrFail()

comment:2 by Martin Sjölund, 14 years ago

OM 1.6.0 has these as part of the init-file

Note: See TracTickets for help on using tickets.