-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
final or not final? #2676
Comments
I would prefer it is legal, and think that it is easier to understand for replaceable. I would actually see three possibilities:
I prefer 1, but https://specification.modelica.org/master/inheritance-modification-and-redeclaration.html#final-element-modification-prevention indicates 2. |
Alternative 2 corresponds to my intuition about |
I'd have to agree that alternative 2 is the only alternative that makes sense to me. I'd have a really hard time trying to convince Modelica users that if they declare a class |
Agreed on second thought, and thus it seems this is just a question that has been answered and can be closed. |
Perhaps we should still clarify that a |
However, there are a number of modifiers for One example is in Modelica.Fluid.Examples.HeatExchanger.BaseClasses.BasicHX:
with Modelica.Fluid.Pipes.DynamicPipe:
(and similarly for the inherited |
Are you saying that the final prefix for a class if occurring in a modification should be interpreted differently? That it should be allowed to change a parameter inside a redeclared final class? See example below.
|
No, it was just an observation that some had that idea - and we need to correct MSL to be consistent with this. |
…e class will be final which in some cases could lead to problems. modelica/ModelicaSpecification#2676
Clarifying that and adding an example makes sense. |
* Clarify final for classes. Closes #2676 Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
…e class will be final which in some cases could lead to problems. modelica/ModelicaSpecification#2676
Otherwise the class will be final which in some cases could lead to problems. modelica/ModelicaSpecification#2676
Otherwise the class will be final which in some cases could lead to problems. modelica/ModelicaSpecification#2676
Otherwise the class will be final which in some cases could lead to problems. modelica/ModelicaSpecification#2676
Otherwise the class will be final which in some cases could lead to problems. modelica/ModelicaSpecification#2676
Otherwise the class will be final which in some cases could lead to problems. modelica/ModelicaSpecification#2676
Otherwise the class will be final which in some cases could lead to problems. modelica/ModelicaSpecification#2676 Co-authored-by: OLSSON Hans <Hans.Olsson@3ds.com>
Otherwise the class will be final which in some cases could lead to problems. modelica/ModelicaSpecification#2676 Co-authored-by: OLSSON Hans <Hans.Olsson@3ds.com>
In
MyPackage.MyModel
below, is the modification ofa(x=4)
legal (considering that the model A has afinal
prefix to it)?The text was updated successfully, but these errors were encountered: