#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
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)
follow-up: 2 comment:1 by , 7 years ago
comment:2 by , 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 , 7 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
follow-up: 5 comment:4 by , 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?
comment:5 by , 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.
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, butExtObj
is a class extending fromExternalObject
which means the constructor should be called instead. It's not a big problem once someone starts to implement it.