Opened 5 years ago

Closed 5 years ago

#5910 closed defect (fixed)

"Cannot resolve type of expression" when function output is given by functionals

Reported by: dariomangoni@… Owned by: Per Östlund
Priority: high Milestone: 1.16.0
Component: New Instantiation Version: v1.16.0-dev
Keywords: Cc:

Description

Basically, this works:

function G
  input TestGTest2.FunctionsPrototypes.Gsubfun fun;
  input Real def;
  output Real f;
algorithm
  f:= fun(inVal=def);
end G;

while this doesn't

function G
  input TestGTest3.FunctionsPrototypes.Gsubfun fun;
  input Real def;
  output Real f;
algorithm
  f:= fun(inVal=def) + fun(inVal=def);
end G;

error is:

Cannot resolve type of expression fun(BOX(def)) + fun(BOX(def)). The operands have types #Real, #Real in component <NO_COMPONENT>.

the only change is in the output of function G.

I'm on OpenModelica v1.16.0-dev-259-g8a5138f38 on Win10 x64

See minimal example

Attachments (1)

GTest.zip (3.1 KB ) - added by dariomangoni@… 5 years ago.
minimal example

Download all attachments as: .zip

Change History (4)

by dariomangoni@…, 5 years ago

Attachment: GTest.zip added

minimal example

comment:1 by Francesco Casella, 5 years ago

Component: Code GenerationNew Instantiation
Owner: changed from Lennart Ochel to Per Östlund
Status: newassigned

comment:2 by Francesco Casella, 5 years ago

Milestone: Future1.16.0

comment:3 by Per Östlund, 5 years ago

Resolution: fixed
Status: assignedclosed

Fixed in 98a8dbc.

Note: See TracTickets for help on using tickets.