Opened 13 years ago
Last modified 12 years ago
#1749 closed defect
Tuple assignment error produces two error messages, whereof one is not right — at Initial Version
Reported by: | Peter Aronsson | Owned by: | Peter Aronsson |
---|---|---|---|
Priority: | critical | Milestone: | 1.9.0 |
Component: | Frontend | Version: | |
Keywords: | Cc: | Peter Aronsson |
Description
The following model:
{{{model Model1
Real[3] x;
Real y;
function test
input Real x;
input Real x2;
output Real y[3];
output Real z;
algorithm
y:={x,x2 + 1,x + 2};
z:=x22;
end test;
algorithm
(y,x):=test(time, time2);
end Model1;}}}
produces the following error messages:
Error processing file: model1.mo [model1.mo:15:3-15:28:writable] Error: Type mismatch in assignment in (y,x) := M odel1.test(time,time ^ 2.0) of (Real, Real[3]) := (Real[3], Real)
{{{[model1.mo:15:3-15:28:writable] Error: Tuple assignment only allowed when rhs is
function call (in Model1.test(time,time 2.0))
Error: Error occurred while flattening model Model1}}}
Clearly, the second error is not true, and it should not be printed. This is a common type of mistake in the compiler that probably originates from the fail semantics of RML combined with unsufficient programming logic ;-)