#1934 closed defect (fixed)
Support calling functions via component reference
Reported by: | Christian Schubert | Owned by: | Adrian Pop |
---|---|---|---|
Priority: | high | Milestone: | 1.14.0 |
Component: | Frontend | Version: | trunk |
Keywords: | replaceable partial function | Cc: | Martin Sjölund |
Description
Hi,
while testing several Hydraulics libraries I encountered the following problem with OpenModelica:
We have a partial record which defines a partial replaceable function. In a subclass the function is redeclared with a proper implementation.
This record is then used in as an inner/outer variable where the outer variable is defined as the baseclass and the inner variable is the proper subclass.
Unfortunately OpenModelica tries to compile the partial function from the inner baseclass and thus the model becomes invalid.
In the simplified submodel attached there seems to be also a problem with lookup which does not occur in dymola?!
This technique is found in several different libraries, so I use priority = High.
Background:
For every fluid there is a record specifying a function for calculating the bulk modulus. We have a single BaseClass for all fluids defining which functions have to be implemented. All library components then use 'outer BaseClass' in their implementations hoping that they use the proper inner model from the top model.
Attachments (2)
Change History (17)
by , 12 years ago
by , 12 years ago
comment:1 by , 12 years ago
comment:2 by , 12 years ago
mikaelf, the reported bug has nothing to do with the outer with a partial type.
Your example will work *if* you specify a inner which is not partial.
If you don't specify any inner then the outer type will be used/instantiated and of course you will run into issues because is partial!
comment:3 by , 12 years ago
Hm, this bug has mostly to do with calling a function via a component reference.
I'll see what I can do.
comment:4 by , 12 years ago
Status: | new → assigned |
---|---|
Summary: | replaceable partial function → Support calling functions via component reference |
comment:6 by , 10 years ago
Milestone: | 1.9.1 → 1.9.2 |
---|
This ticket was not closed for 1.9.1, which has now been released. It was batch modified for milestone 1.9.2 (but maybe an empty milestone was more appropriate; feel free to change it).
comment:7 by , 10 years ago
Milestone: | 1.9.2 → 1.9.3 |
---|
Milestone changed to 1.9.3 since 1.9.2 was released.
comment:12 by , 8 years ago
Milestone: | 1.11.0 → 1.12.0 |
---|
Milestone moved to 1.12.0 due to 1.11.0 already being released.
comment:13 by , 7 years ago
Milestone: | 1.12.0 → Future |
---|
The milestone of this ticket has been reassigned to "Future".
If you think the issue is still valid and relevant for you, please select milestone 1.13.0 for back-end, code generation and run-time issues, or 2.0.0 for front-end issues.
If you are aware that the problem is no longer present, please select the milestone corresponding to the version of OMC you used to check that, and set the status to "worksforme".
In both cases, a short informative comment would be welcome.
comment:14 by , 4 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
This seems to have been fixed some time ago, it now seems to work fine with both the old and the new frontend.
comment:15 by , 4 years ago
Milestone: | Future → 1.14.0 |
---|
This defect is related to the newly clarified section of the MSL specification about the combination of outer with a partial model. https://trac.modelica.org/Modelica/ticket/1074
Currently omc returns an error for illegal instantiation of a partial class in this very simple example, which should now be allowed.