Skip to content
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

Just use "redeclare" instead of "redeclare final" #3649

Merged
merged 1 commit into from
Feb 8, 2021

Conversation

HansOlsson
Copy link
Contributor

Otherwise the class will be final which in some cases lead to problems.
modelica/ModelicaSpecification#2676

@HansOlsson HansOlsson added L: Electrical.Machines Issue addresses Modelica.Electrical.Machines L: Fluid Issue addresses Modelica.Fluid (excl. Dissipation) specification Issue (also) addresses the Modelica language specification labels Oct 12, 2020
@HansOlsson HansOlsson requested review from AHaumer and casella and removed request for casella and AHaumer October 12, 2020 07:25
Copy link
Contributor

@AHaumer AHaumer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand but I'm not involved in Fluid, so maybe ask someone more famailiar with Fluid?

@HansOlsson HansOlsson removed the L: Electrical.Machines Issue addresses Modelica.Electrical.Machines label Oct 12, 2020
@HansOlsson
Copy link
Contributor Author

I understand but I'm not involved in Fluid, so maybe ask someone more famailiar with Fluid?

Sorry, I got confused, one issue involved the Machines-library in the Fluid-library, not the Electrical.Machines-library.

Copy link
Contributor

@henrikt-ma henrikt-ma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look harmless to me, as they only remove the use of final when redeclaring classes.

However, I am not sure exactly what problem is being solved here. My guess is that this is really just a matter of removing some final that are believed to have been added for the wrong reason (namely, to make sure that the redeclaration isn't treated as redeclare replaceable). If my guess is wrong, however, I am unable to tell whether the proposed removal of final would have the desired effect, and it must be noted that the very meaning of a class being final is subject to ongoing discussion in #2719.

@HansOlsson
Copy link
Contributor Author

However, I am not sure exactly what problem is being solved here. My guess is that this is really just a matter of removing some final that are believed to have been added for the wrong reason (namely, to make sure that the redeclaration isn't treated as redeclare replaceable). If my guess is wrong, however, I am unable to tell whether the proposed removal of final would have the desired effect, and it must be noted that the very meaning of a class being final is subject to ongoing discussion in #2719.

You mean modelica/ModelicaSpecification#2719
However, that issue is now resolved and the impact on this use of final redeclare is that it goes from a bit weird with unclear consequences to bad and often making other models illegal.
Thus I will merge this PR soonish.

@beutlich
Copy link
Member

beutlich commented Feb 5, 2021

Off-topic: I'll care for a clean commit history w/o merge commits.

Otherwise the class will be final which in some cases could lead to problems.
modelica/ModelicaSpecification#2676
@beutlich
Copy link
Member

beutlich commented Feb 5, 2021

Off-topic: I'll care for a clean commit history w/o merge commits.

Done.

@beutlich beutlich added this to the MSL4.1.0 milestone Feb 5, 2021
@HansOlsson HansOlsson merged commit d01222b into modelica:master Feb 8, 2021
@HansOlsson HansOlsson deleted the RedeclareFinal branch February 8, 2021 11:48
@beutlich
Copy link
Member

beutlich commented Feb 8, 2021

Should this be back-ported to the maintenance branches?

@HansOlsson
Copy link
Contributor Author

Should this be back-ported to the maintenance branches?

Yes.

@beutlich
Copy link
Member

Should this be back-ported to the maintenance branches?

Yes.

Done by #3751 and #3752 before it will get forgotten.

HansOlsson added a commit to HansOlsson/Modelica that referenced this pull request Feb 25, 2021
beutlich pushed a commit that referenced this pull request Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: Fluid Issue addresses Modelica.Fluid (excl. Dissipation) specification Issue (also) addresses the Modelica language specification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants