Opened 19 years ago

Last modified 19 years ago

#28 closed defect (fixed)

Import of constant in packages does not work.

Reported by: Peter Aronsson Owned by: Peter Aronsson
Priority: blocker Milestone:
Component: Version:
Keywords: Cc: Peter Aronsson, Adrian Pop

Description


Change History (1)

comment:1 by Peter Aronsson, 19 years ago

Importing a constant from a package does not work. This is because
lookup_var_in_packages (or actually lookup_var_local) does not check import
statements.

The following code triggers the bug.

Workaround: Remove the import and use the fully qualified name of the constant
instead.

package A
package Constants

constant Real PI=3.1415;
constant Real e=2.71;

end Constants;
end A;

model ImportConstantTest

import A.Constants.PI;
Real x;

equation

x*4*PI=1;

end ImportConstantTest;

Note: See TracTickets for help on using tickets.