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

Operator inheritance #1065

Closed
modelica-trac-importer opened this issue Nov 4, 2018 · 2 comments
Closed

Operator inheritance #1065

modelica-trac-importer opened this issue Nov 4, 2018 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@modelica-trac-importer
Copy link
Collaborator

Reported by per.ostlund on 8 Apr 2013 13:47 UTC
Section 4.6 says "It is not legal to extend from any of its enclosing scopes" regarding operator, operator function and operator record. This sentence is ambigouous though, since it could either mean that another class is not allowed to extend from any of the operator type's enclosing scopes, or that none of the enclosing scopes are allowed to extend. I do now see how the operator example in 4.6 supports either interpretation though, so the actual meaning might be something else.

Also, the table in section 7.1.3 is missing operator record, but perhaps that's because it's not legal to extend from an operator record. It might be good to add it for consistency though.


Migrated-From: https://trac.modelica.org/Modelica/ticket/1065

@modelica-trac-importer
Copy link
Collaborator Author

Comment by hansolsson on 4 Jun 2013 11:50 UTC
Consider:

package A 
  extends Icon; //Ok.
  operator record B end B;
end A;
package A2
  extends A; // Not legal
end A2;
package A3=A; // Not legal

Is it unclear that "from" means "extends A" and not "extends" in A?

The reason for the rule is that we want lexical names and do not want A2.B and A.B to sort of be equivalent (with all complications for rules about overloading).

Conclusion - add this example.

@modelica-trac-importer
Copy link
Collaborator Author

Comment by hansolsson on 5 Jun 2013 13:32 UTC
Added in r6604

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests