#4667 closed defect (fixed)
Unrecognized external object in NF
Reported by: | casella | Owned by: | perost |
---|---|---|---|
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)
comment:1 follow-up: ↓ 2 Changed 7 years ago by sjoelund.se
comment:2 in reply to: ↑ 1 Changed 7 years ago by perost
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 Changed 7 years ago by perost
- Resolution set to fixed
- Status changed from new to closed
comment:4 follow-up: ↓ 5 Changed 7 years ago by 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?
comment:5 in reply to: ↑ 4 Changed 7 years ago by perost
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, 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.