Opened 14 years ago

Last modified 11 years ago

#1427 assigned defect

Assignment of continuous signals to discrete variables should be rejected — at Version 1

Reported by: Martin Sjölund Owned by: Martin Sjölund
Priority: high Milestone: Future
Component: Backend Version:
Keywords: Cc: Martin Sjölund

Description (last modified by Martin Sjölund)

Both of the following work, but should not:

class A
  Integer i = integer(time);
  discrete Real r = time;
end A;

Note that in a function, an assignment i := r; should still be allowed since in a function, all changes are discrete or continuous depending on your viewpoint. There probably will not be problems with inline functions since the variability of the call is simply the highest variability of the inputs.

(3.8 Variability of Expressions "If v is a discrete-time component then expr needs to be a discrete-time expression.")

Change History (1)

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

Cc: sjoelund.se, → sjoelund.se
Component: Backend
Description: modified (diff)
Note: See TracTickets for help on using tickets.