Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#2977 closed defect (fixed)

Array slice should have implicit : in trailing index positions

Reported by: Henrik Tidefelt Owned by: Per Östlund
Priority: normal Milestone: 1.9.4
Component: Frontend Version: trunk
Keywords: Cc:

Description

The following model, taken from page 111 in the Modelica specification version 3.3,

model Page111
  type Point = Real[3];
  Point p1[10];
  Real r[3] = p1[2]; // equivalent to r[3] = p1[2, :]
end Page111;

doesn't validate:

[<interactive>:4:3-4:20:writable] Error: Wrong number of subscripts in p1[2] (1 subscripts for 2 dimensions).
[<interactive>:4:3-4:20:writable] Error: Variable p1[2] not found in scope Page111.
Error: Error occurred while flattening model Page111

Change History (6)

comment:1 by Martin Sjölund, 10 years ago

Owner: changed from somebody to Per Östlund
Status: newassigned

comment:2 by Per Östlund, 10 years ago

Priority: criticalnormal

The spec is a bit fuzzy on this, so I opened a ticket here. Unless otherwise decided on the ticket I consider this illegal, because the spec doesn't explicitly say that indices should be padded with : (examples are frequently found to be wrong in the spec). Also, Dymola says that this example is illegal, which is the reason I implemented the check in the first place.

comment:3 by Henrik Tidefelt, 10 years ago

The fuzziness has been resolved in favor of considering it legal, see Modelica ticket.

comment:4 by Per Östlund, 10 years ago

Resolution: fixed
Status: assignedclosed

Should be fixed in r24379.

comment:5 by Dietmar Winkler, 9 years ago

Milestone: Futurepre1.9.4

It doesn't make sense to keep closed ticket in the "Future" milestone that were simply forgotten to assign to the correct milestone in the past.

comment:6 by Martin Sjölund, 7 years ago

Milestone: pre1.9.41.9.4

Removing the pre1.9.4 milestone in favor of 1.9.4.

Note: See TracTickets for help on using tickets.