Opened 10 years ago
Closed 10 years ago
#2896 closed defect (fixed)
Looping over list array element doesn't work correctly
Reported by: | Per Östlund | Owned by: | Martin Sjölund |
---|---|---|---|
Priority: | high | Milestone: | 1.9.1 |
Component: | MetaModelica | Version: | trunk |
Keywords: | Cc: |
Description
Calling this function:
function test protected array<list<Integer>> a; algorithm a := arrayCreate(1, {1, 2, 3}); for i in a[1] loop print("i = " + intString(i) + "\n"); end for; end test;
gives the output:
i = 1 i = 70330909930353
which is not quite the expected result.
Change History (3)
comment:1 by , 10 years ago
comment:3 by , 10 years ago
Milestone: | Bootstrapping → 1.9.1 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Fixed simplify in r22766.
Note:
See TracTickets
for help on using tickets.
Aha, it thinks
a[1]
is an array, and generates code for that. Replacinga[1]
witharrayGet(a, 1)
works.