Constants not evaluated in match patterns
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.
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
(4)
Description: |
modified (diff)
|
Milestone: |
Future → 1.9.4
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
Milestone: |
1.9.4 → 1.9.4-1.9.x
|
Milestone: |
1.9.4-1.9.x → 1.9.4
|
Fixed in 457cabf
We support boxed types, integers, reals, booleans, and enumerations in this way.