Opened 14 years ago

Last modified 14 years ago

#1322 closed defect (fixed)

Wrong error: Tuple assignment only allowed when rhs is a function call

Reported by: Adrian Pop Owned by: Adrian Pop
Priority: high Milestone:
Component: Version: 1.6.0
Keywords: Cc: Adrian Pop, AlexeyLebedev

Description

If we have an external function that returns a tuple:

equation 
  (del, -vx) = ExternalFunc1(val); 

we get this error:

Tuple assignment only allowed when rhs is a function call.

This worked in 1.5.0 (but no longer works in trunk).
The bug was reported here:

http://www.openmodelica.org/index.php?option=com_agora&task=topic&id=132&Itemid=87

Change History (2)

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

It shouldn't work! An error message explaining why should be added.
(Tuple assignments only allow expression or tuple of crefs on lhs)

There also seems to be bugs when calling:
del = ExternalFunc1(val); (If val is constant... Works as expected, (del,_) = ExternalFunc1(val) if val is not constant)

comment:2 by AlexeyLebedev, 14 years ago

Added a new error message for tuple assignments where lhs tuple contains not only component references in revision 6449.
del = ExternalFunc1(val) and (del,_) = ExternalFunc1(val) work fine for me even if val is not constant.

Note: See TracTickets for help on using tickets.