Opened 5 years ago
Last modified 3 years ago
#5580 new defect
--evaluateProtectedParameters should default to true
Reported by: | Francesco Casella | Owned by: | Karim Adbdelhak |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Backend | Version: | |
Keywords: | Cc: |
Description
I scanned the specification looking for the various meanings of protected
, trying to understand how should we deal with protected
parameters.
In particular, Section 4.1 states:
A protected element, P, in classes and components may not be accessed via dot notation (e.g., A.P, a.P, a[1].P, a.b.P, .A.P; but there is no restriction on using P or P.x for a protected element P). They may not be modified or redeclared except for modifiers applied to protected elements in a base-class modification (not inside any component or class) and the modifier on the declaration of the protected element.
As far as final
is concerned, Section 7.2.6 states
An element defined as final by the final prefix in an element modification or declaration cannot be modified by a modification or by a redeclaration
We all agree that the interpretation of final
can be extended to mean that you can't change the parameter value at runtime. What I understand from the two excerpts of the specifications is that from this point of view there is no difference between a final
parameter and a protected
parameter: both cannot be modified. Redeclarations do not apply at runtime, because we are using statically compiled models,so they are ruled out anyway.
Conclusion:
- there is no reason to treat
protected
parameters differently fromfinal
parameters --evaluateProtectedParameters
should default totrue
.
Change History (7)
follow-up: 2 comment:1 by , 5 years ago
comment:2 by , 5 years ago
Replying to Karim.Abdelhak:
--evaluateProtectedParameters=true
only affects the backend moduleevaluateParameters
. Should it be done by the frontend, just as final parameters?
I wonder if it may be the case that there is some further evaluation that can only be carried out after the backend has performed some optimizations and symbolic manipulations.
From what I understand the backend module should be superfluous with the new frontend anyways. When i got some time i will check what breaks when switching it off
Sounds like a good idea.
comment:3 by , 5 years ago
The only optimization running before the module evaluateParameters
is inlining of functions with annotation Evaluate=true
.
comment:4 by , 5 years ago
Milestone: | 1.14.0 → 1.16.0 |
---|
Releasing 1.14.0 which is stable and has many improvements w.r.t. 1.13.2. This issue is rescheduled to 1.16.0
comment:6 by , 4 years ago
Milestone: | 1.17.0 → 1.18.0 |
---|
Retargeted to 1.18.0 because of 1.17.0 timed release.
--evaluateProtectedParameters=true
only affects the backend moduleevaluateParameters
. Should it be done by the frontend, just as final parameters?From what i understand the backend module should be superfluous with the new frontend anyways. When i got some time i will check what breaks when switching it of, i would really like to remove it if it's not needed.