Opened 11 years ago
Closed 11 years ago
#2262 closed defect (fixed)
empty vector as first argument to change
Reported by: | Lennart Ochel | Owned by: | Lennart Ochel |
---|---|---|---|
Priority: | blocker | Milestone: | 1.9.0 |
Component: | Frontend | Version: | trunk |
Keywords: | Cc: | Martin Sjölund |
Description
model test Boolean b[0]; anyChange ac(vec = b); Integer d(start = 0, fixed = true); equation when ac.anychange then d = pre(d) + 1; end when; end test; block anyChange "does any entry of a boolean vector change its value?" input Boolean vec[:]; output Boolean anychange; algorithm anychange:=false; for i in 1:size(vec, 1) loop anychange:=anychange or change(vec[i]); end for; end anyChange;
Error Message:
"[<interactive>:8:7-8:45:writable] Error: First argument to change in component ac must be a variable. Error: Error occurred while flattening model test "
Change History (6)
comment:1 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → accepted |
comment:2 by , 11 years ago
comment:3 by , 11 years ago
It is a problem with trying to determine if it is discrete or not by looking at the elaborated expression and lookupVar. Which will fail to detect variables that become discrete due to when-sections. It should probably be possible to relax these checks and instead do them in the backend...
comment:4 by , 11 years ago
Fixed in r16481. Add the testcase and close the ticket :)
Version 0, edited 11 years ago by (next)
comment:5 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | accepted → assigned |
comment:6 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
This can be used as test case: