Opened 14 years ago
Last modified 10 years ago
#1688 assigned defect
Reinit of non-state variables
| Reported by: | Martin Sjölund | Owned by: | Lennart Ochel |
|---|---|---|---|
| Priority: | high | Milestone: | Future |
| Component: | Backend | Version: | |
| Keywords: | Cc: | Adrian Pop, Martin Sjölund, Jens Frenkel |
Description (last modified by )
The following model is accepted by OpenModelica, but should not:
model M
Real r = time;
equation
when sample(0,0.1) then
reinit(r, 2*time);
end when;
end M;
The appropriate error should be:
Cannot use reinit() on r as it cannot be selected as a state variable
Change History (8)
comment:1 by , 13 years ago
| Cc: | added; removed |
|---|---|
| Component: | → Backend |
| Description: | modified (diff) |
comment:2 by , 13 years ago
comment:3 by , 13 years ago
| Cc: | added |
|---|
comment:4 by , 13 years ago
| Cc: | added; removed |
|---|
We might catch the reinint in when initial in the front-end.
I'll see if i can add this rule to the already existing ones.
comment:5 by , 13 years ago
comment:6 by , 13 years ago
I opened a new bug about the reinit in when with
condition initial: #1972 so we can talk about this
more.
comment:7 by , 12 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:8 by , 10 years ago
| Milestone: | → Future |
|---|
Note:
See TracTickets
for help on using tickets.

look also for #51. There is reinit used in a when initial() clause:
That makes no sense and is not valid. Perhaps, that should be caught in the Frontend?