Opened 11 years ago

Closed 11 years ago

#2289 closed defect (fixed)

instantiation of a very simple model failed

Reported by: Lennart Ochel Owned by: Martin Sjölund
Priority: blocker Milestone: 1.9.0
Component: Frontend Version: trunk
Keywords: Cc:

Description (last modified by Lennart Ochel)

The following model fails during instantiation:

model foo
  parameter Integer N = 0;
  Real a[N];
algorithm
  if N > 0 then
    a[1] := 1.0;
    for i in 2:N loop
      a[i] := a[i-1] + 1.0;
    end for;
  end if;
end foo;

output:

Translation | 0:0-0:0  | Error occurred while flattening model foo
Translation | 6:5-6:16 | Variable a[1] not found in scope foo.
Translation | 6:5-6:16 | Illegal subscript [1] for dimensions 0 in component <NO COMPONENT>.
Scripting   | 0:0-0:0  | Instantiation of foo failed.

This should be fixed as soon as possible, because it blocks the Petri net library.

Change History (3)

comment:1 by Lennart Ochel, 11 years ago

Description: modified (diff)

comment:2 by Martin Sjölund, 11 years ago

Owner: changed from somebody to Martin Sjölund
Status: newaccepted

comment:3 by Martin Sjölund, 11 years ago

Resolution: fixed
Status: acceptedclosed

I fixed this in some revision during my vacation but forgot to close this (and made the commit like 1 week after I fixed the problem)...

Note: See TracTickets for help on using tickets.