Opened 10 years ago

Last modified 9 years ago

#3005 closed defect

Constants not evaluated in match patterns — at Initial Version

Reported by: Per Östlund Owned by: Martin Sjölund
Priority: normal Milestone: 1.9.4
Component: MetaModelica Version: trunk
Keywords: Cc:

Description

Calling the following function from a script result in a compiler error "use of undeclared identifier '_n'. It seems we don't constant evaluate constants that are used in patterns, which we probably should.
{{{!mo
package P

constant Integer n = 2;

function f

input Integer x;

algorithm

_ := match x

case n then ();
else ();

end match;

end f;

end P;

function test

input Integer x;

algorithm

P.f(x);

end test;
}}}

Change History (0)

Note: See TracTickets for help on using tickets.