Opened 11 years ago
Closed 11 years ago
#2192 closed defect (fixed)
error during expanding of a slice subscript expression
Reported by: | lochel | Owned by: | somebody |
---|---|---|---|
Priority: | high | Milestone: | 1.9.0 |
Component: | Frontend | Version: | trunk |
Keywords: | Cc: | perost, adrpo, lochel |
Description
model bug Integer a[3]; Real b[3]; Real c[2]; Integer n; equation n = 2; algorithm a := {1, 2, 3}; b := {1.1, 2.1, 3.1}; c := b[a[1:n]]; end bug;
OpenModelica Output:
messages = "Simulation failed for model: bug Error: Internal error ComponentReference.expandSlice: Unknown slice a[1:n] Error: Internal error ComponentReference.expandSlice: Unknown slice 1:n Error: Internal error ComponentReference.expandSlice: Unknown slice a[1:2] Error: Internal error ComponentReference.expandSlice: Unknown slice 1:2 Error: Internal error ComponentReference.expandSlice: Unknown slice a[1:2] Error: Internal error ComponentReference.expandSlice: Unknown slice 1:2 Error: Internal error ComponentReference.expandSlice: Unknown slice a[1:2] Error: Internal error ComponentReference.expandSlice: Unknown slice 1:2 Error: Internal error ComponentReference.expandSlice: Unknown slice a[1:2] Error: Internal error ComponentReference.expandSlice: Unknown slice 1:2 Error: Internal error ComponentReference.expandSlice: Unknown slice a[1:2] Error: Internal error ComponentReference.expandSlice: Unknown slice 1:2 Error: Internal error ComponentReference.expandSlice: Unknown slice a[1:2] Error: Internal error ComponentReference.expandSlice: Unknown slice 1:2 Error: Internal error ComponentReference.expandSlice: Unknown slice a[1:2] Error: Internal error ComponentReference.expandSlice: Unknown slice 1:2 [CodegenC.tpl:8632:38-8632:38:writable] Error: Template error: dimension: INVALID_DIMENSION n "
I am not pretty sure if this is pure Modelica. Even dymola is not able to handle this model. But maybe that doesn't mean anything. So probably we should get this running.
Change History (2)
comment:1 Changed 11 years ago by bernhard.bachmann@…
comment:2 Changed 11 years ago by perost
- Resolution set to fixed
- Status changed from new to closed
Fixed in r16112.
Note: See
TracTickets for help on using
tickets.
This is correct Modelica and does work correctly in Dymola 2013 FD01. This functionality is important for supporting the Modelica Petri Net Library PNLib!