Opened 14 years ago

Last modified 14 years ago

#1467 closed defect (fixed)

Incorrect constant evaluation in case of arrays?

Reported by: AlexeyLebedev Owned by: AlexeyLebedev
Priority: high Milestone:
Component: Instantiation Version:
Keywords: Cc: AlexeyLebedev,

Description

The example
{{{class A

class B
Real z = A.y;
end B;
constant Real y;
B[3] b;

end A;

class T

A[2] a(y = {1,2});

end T;}}}

produces the following:
{{{ class T

constant Real a[1].y = 1.0;

Real a[1].b[1].z = 1.0;

Real a[1].b[2].z = 1.0;

Real a[1].b[3].z = 1.0;

constant Real a[2].y = 2.0;

Real a[2].b[1].z = 1.0;

Real a[2].b[2].z = 1.0;

Real a[2].b[3].z = 1.0;

end T;}}}I.e., a.b.z gets a wrong binding.

Change History (1)

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

Note: This works when running the following script...

setOption(envCache,false);
loadFile("i.mo");
instantiateModel(T);

(Bootstrapping also requires envCache = false, so something is wrong for sure)

Note: See TracTickets for help on using tickets.