Opened 12 years ago
Last modified 7 years ago
#1842 assigned defect
Illegal redeclare should be rejected by the NF with appropriate error message
Reported by: | julian.wyszynski | Owned by: | Per Östlund |
---|---|---|---|
Priority: | high | Milestone: | 2.1.0 |
Component: | New Instantiation | Version: | |
Keywords: | Cc: |
Description
Model "Nitri1" in attached Package results in "Stack Overflow Error" when instantiating in OMShell.
When deleting line 33 "package Test = WasteWater.ASMx;" omc.exe crashes.
This structure is used a lot in our Library and is working in Dymola. It would be nice if it would run in OpenModelica (or at least a similar structure).
Attachments (1)
Change History (17)
by , 12 years ago
Attachment: | StackOverflowError.mo added |
---|
comment:1 by , 12 years ago
Component: | Backend → Frontend |
---|---|
Owner: | changed from | to
Status: | new → accepted |
comment:2 by , 12 years ago
Owner: | changed from | to
---|---|
Status: | accepted → assigned |
comment:3 by , 12 years ago
The model is not legal Modelica, since it contains extends which are not transitively non-replaceable (section 7.1.4 in the Modelica 3.3 specification). E.g. Nitri1 extends from JModel2 which extends from AerationModel, which is both replaceable and contains replaceable components. Modelica does not allow classes that you extend from to be replaceable, or to contain replaceable elements. Dymola supports this anyway but shows warnings for it, but implementing this language extension in OpenModelica is currently not a priority.
Of course, the compiler shouldn't get stack overflows, so we need to detect this case and print a proper error message for this.
comment:5 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:6 by , 10 years ago
Milestone: | 1.9.2 → 1.9.3 |
---|
Milestone changed to 1.9.3 since 1.9.2 was released.
comment:11 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:12 by , 8 years ago
Is this fixed? I ran
loadFile("StackOverflowError.mo");getErrorString(); simulate(StackOverflowError.ASMx.GenericUnits.Nitri1);getErrorString();
and it simulated without any error or stack overflow.
comment:13 by , 7 years ago
Component: | Frontend → New Instantiation |
---|---|
Milestone: | 1.12.0 → Future |
The stack overflow seems to be fixed, but according to comment:3, this model should be rejected by the compiler, or at least one warning should be generated
follow-up: 15 comment:14 by , 7 years ago
Summary: | Stack Overflow Error → Illegal redeclare should be rejected by the NF |
---|
Changed the ticket summary to better reflect the current situation.
As of v1.13.0-dev-672-g87286cb84, the following error is obtained with the new front end
[1] 18:57:41 Translation Error [StackOverflowError: 22:9-22:75]: Base class AerationCommon not found in scope JModel2.
I'm not sure if this mode failure is the expected one. @perost, can you please comment on that?
comment:15 by , 7 years ago
Replying to casella:
I'm not sure if this mode failure is the expected one. @perost, can you please comment on that?
The error message should be improved, but the model is not expected to work as per my previous comment.
comment:16 by , 7 years ago
Milestone: | Future → 2.1.0 |
---|---|
Summary: | Illegal redeclare should be rejected by the NF → Illegal redeclare should be rejected by the NF with appropriate error message |
Updated issue summary and postponed to 2.1.0
Package showing Error