Opened 10 years ago
Closed 4 years ago
#2783 closed defect (fixed)
encapsulated model cannot find function
Reported by: | Andreas Hofmann | Owned by: | Per Östlund |
---|---|---|---|
Priority: | high | Milestone: | 1.16.0 |
Component: | New Instantiation | Version: | trunk |
Keywords: | encapsulated | Cc: |
Description
Hi everyone!
Having a partial model which calls a function and is extended in an encapsulated model does not work. I'd be great if you guys could have a look.
Find attached a small example of the issue.
Best regards,
Andreas
Attachments (1)
Change History (4)
by , 10 years ago
Attachment: | TestEncapsulated.mo added |
---|
comment:1 by , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 10 years ago
This is the usual issue with how we incorrectly handle extends. Inherited elements are copied into the extending class, and paths are "fixed" by fully qualifying them. They are not marked as fully qualified though, so such "fixed" paths become restricted by encapsulation (and might not even point to the correct element anymore). Marking the paths as fully qualified does not work either though, since a fully qualified path does not always point to the same element as a non-qualified path (due to modifiers, etc.), which results in stack overflows for some models because the wrong element is used.
The solution is to rewrite the flattening of extends correctly. This is currently not possible though, since the Modelica specification does not specify how to flatten extends (see #1458 and #1397 on Modelica Trac). Hopefully this is resolved at the next design meeting (in december?), but until then I don't know what to do about this issue.
comment:3 by , 4 years ago
Component: | Frontend → New Instantiation |
---|---|
Milestone: | Future → 1.16.0 |
Resolution: | → fixed |
Status: | assigned → closed |
Fixed in the new frontend.
Smaller model: