Opened 19 years ago

Last modified 19 years ago

#28 closed defect (fixed)

Import of constant in packages does not work.

Reported by: petar Owned by: petar
Priority: blocker Milestone:
Component: Version:
Keywords: Cc: petar, adrpo

Description


Change History (1)

comment:1 Changed 19 years ago by petar

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.