Opened 5 years ago
Closed 5 years ago
#5712 closed defect (fixed)
The old frontend allows duplicate variables in protected sections input sections and output sections
Reported by: | Owned by: | John Tinnerholm | |
---|---|---|---|
Priority: | low | Milestone: | Future |
Component: | Frontend | Version: | v1.16.0-dev |
Keywords: | Semantics, MetaModelica, Modelica | Cc: |
Description (last modified by )
function fz input Integer I; input Integer I; end fz; function fy protected Integer I; Integer I; end fy; function fx input Integer I; input Integer I; protected Integer X; Integer X; end fx;
Duplicate variables in protected section compiles, they are simply replaced in the backend. However, this allows modellers to write duplicate declarations in MetaModelica, and in Modelica.
It seems we allow it since the specification says that duplication is allowed during inheritance.
Change History (8)
comment:1 by , 5 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:2 by , 5 years ago
The old front-end is still used for MetaModelica, none of that was ported to the NF yet.
This fix is mostly for MM, but is good for Modelica too.
follow-up: 5 comment:3 by , 5 years ago
@casella
That is true for Modelica, sadly the old frontend is still in use for MetaModelica :(
I do some work over there for which fixing this ticket is a requirement.
I have not checked if this behaviour exists in the NF as well if it does I would be happy to patch it!
I made a fix Sunday evening, that needs to be polished, then this is pretty much done
comment:4 by , 5 years ago
Sorry I did not see that Adrian had already responded.
Ideally, I think MetaModelica's support in NF would be a good thing.
However, I think rather intermix MetaModelica specific extensions in the NFCode, a new folder for the MetaModelica frontend should be created which reuses the stuff used for NF
comment:5 by , 5 years ago
Replying to johti17:
I have not checked if this behaviour exists in the NF as well if it does I would be happy to patch it!
It doesn't, the NF is very strict about not allowing elements with the same name in a scope.
comment:7 by , 5 years ago
Resolution: | wontfix |
---|---|
Status: | closed → reopened |
Sorry, I didn't get that the subject was MetaModelica.
comment:8 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Fixed as a part of the following commit:
https://github.com/OpenModelica/OpenModelica/commit/a4f0ef321055366286d28fe6331c61f986ab755b
@johti17, we no longer maintain the old frontend. In all likelyhood, the new front end will become the default with 1.16.0, or 2.0.0 if we skip 1.16.0.