Opened 12 years ago

Closed 12 years ago

#1969 closed defect (fixed)

function with multiple return value used only first one does not work

Reported by: Jens Frenkel Owned by: Adrian Pop
Priority: blocker Milestone: 1.9.0
Component: Frontend Version: trunk
Keywords: MultiFunctionReturnValueUseOnlyFirst Cc:

Description

According to the msl example

// Real    x[:], y[:], xi, yi;
// Integer iLast, iNew;
        yi = Vectors.interpolate(x,y,xi);
(yi, iNew) = Vectors.interpolate(x,y,xi,iLast=1);

the following model does not work because the FrontEnd does not generate an TSUB Expression around the function call. As a consequence compilation fails.

model MultiFunctionReturnValueUseOnlyFirst
equation
  assert(abs(Modelica.Math.Vectors.interpolate({ 0,  2,  4,  6,  8, 10},{10, 20, 30, 40, 50, 60},5)) < 0.1,"Only a Test");
end MultiFunctionReturnValueUseOnlyFirst;

Attachments (2)

MultiFunctionReturnValueUseOnlyFirst.mo (219 bytes ) - added by Jens Frenkel 12 years ago.
MultiFunctionReturnValueUseOnlyFirst.mos (123 bytes ) - added by Jens Frenkel 12 years ago.

Download all attachments as: .zip

Change History (5)

by Jens Frenkel, 12 years ago

by Jens Frenkel, 12 years ago

comment:1 by Adrian Pop, 12 years ago

Status: newassigned

This is a duplicate of #1946. It seems my fix of it was a bit wrong.
I'll see if I can wrap the fcall expression inside DAE.TSUB.

Cheers,
Adrian Pop/

comment:2 by Adrian Pop, 12 years ago

Hopefully fixed in r14209.

comment:3 by Adrian Pop, 12 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.