Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#4667 closed defect (fixed)

Unrecognized external object in NF

Reported by: Francesco Casella Owned by: Per Östlund
Priority: high Milestone: 2.0.0
Component: New Instantiation Version:
Keywords: Cc:

Description

Please check
https://libraries.openmodelica.org/branches/newInst/Modelica_3.2.2/files/Modelica_3.2.2_Modelica.Electrical.Machines.Examples.AsynchronousInductionMachines.AIMC_Conveyor.err

The following error message is generated:

[/var/lib/hudson/slave/workspace/OpenModelica_TEST_LIBS
 /OpenModelica/OMCompiler/build/lib/omlibrary
 /Modelica 3.2.2/Blocks/Sources.mo:2273:5-2281:49:writable] 
 Error: Expected Modelica.Blocks.Types.ExternalCombiTimeTable
 to be a function, but found class instead.

Modelica.Blocks.Types.ExternalCombiTimeTable is an external object, so it is unclear why the compiler expects a function there.

Change History (5)

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

That's very simple to answer: the new instantiation has no knowledge of external objects. The call of the constructor looks like Path.To.ExtObj() which means it looks like a function call, but ExtObj is a class extending from ExternalObject which means the constructor should be called instead. It's not a big problem once someone starts to implement it.

in reply to:  1 comment:2 by Per Östlund, 7 years ago

Replying to sjoelund.se:

That's very simple to answer: the new instantiation has no knowledge of external objects.

It does actually have quite a lot of knowledge about external objects, I just missed that the class name is used to call the constructor when implementing it.

comment:3 by Per Östlund, 7 years ago

Resolution: fixed
Status: newclosed

Fixed in 8e28309. The mentioned model now fails due to #4660 instead.

comment:4 by Martin Sjölund, 7 years ago

Did you implement the restriction that you can only call the constructor in a binding equation (and not part of a compound expression)? Or do we need an extra pass for this?

in reply to:  4 comment:5 by Per Östlund, 7 years ago

Replying to sjoelund.se:

Did you implement the restriction that you can only call the constructor in a binding equation (and not part of a compound expression)? Or do we need an extra pass for this?

No checks at the moment, it just changes any call to the external object to instead call the constructor. It would be easy to check though, the typing already has all the necessary information.

Note: See TracTickets for help on using tickets.