#1126 closed defect (fixed)
Dangling modifier in extends clauses not detected if name exists locally.
Reported by: | Jan Brugård | Owned by: | Jan Brugård |
---|---|---|---|
Priority: | high | Milestone: | 1.16.0 |
Component: | Frontend | Version: | trunk |
Keywords: | Cc: |
Description
Example:
model A end A; model B extends A(p = 2); parameter Real p; end B;
Example above gives NO warning when checking the class, even though there is no variable p declared in class A. This seems to be because the name p is also used in class B and the check is done after flattening the inheritance hierarchy. If we change the local name to q in class B we will get a warning. See below:
model A end A; model B extends A(p = 2); parameter Real q; end B;
Check of B failed Error: In modifier (p = 2), class or component p not found in <B> Error: Error occured while flattening model B
Here we can see that the error message is also very misleading due to the check being done after flattening. The error message refers to class B and not the inherited class A.
Change History (4)
comment:1 by , 15 years ago
comment:2 by , 10 years ago
Cc: | removed |
---|---|
Component: | → Frontend |
Milestone: | → Future |
Version: | → trunk |
Still an issue, since we handle extends incorrectly.
comment:3 by , 4 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
This is handled correctly by the new frontend, and the old frontend will not be fixed since it's too broken in this regard.
comment:4 by , 4 years ago
Milestone: | Future → 1.16.0 |
---|
http://intranet/trac/mathmodelica/ticket/2436