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

Extending operator record #1497

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

Extending operator record #1497

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

Comments

@modelica-trac-importer
Copy link
Collaborator

Reported by jmattsson on 20 May 2014 14:50 UTC
The table in section 4.6 of the spec contains:

  • You are allowed to extend from an operator record as a short class definition (with certain restrictions).
  • You are not allowed to extend from any enclosing scope of an operator or operator function.
  • operator and operator function are only allowed inside operator record.
    Together this gives that you are only allowed to extend from an operator record (as per the first point) if it doesn't contain any operator and operator function. The rule about enclosing scopes needs to be amended.

(Also, the item in the table for operator refers to "Section Chapter 14".)


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

@modelica-trac-importer
Copy link
Collaborator Author

Comment by hansolsson on 17 Jun 2014 09:23 UTC
Ok, as I see the "operator" and "operator function" the rule about no extend should exclude the special case for "operator record".

@modelica-trac-importer
Copy link
Collaborator Author

Comment by hansolsson on 17 Jun 2014 09:34 UTC
Due to #1459 the new text would be:

operator:
Similar to package; but may only contain declarations of functions. May only be placed in an operator record.

operator function:
Shorthand for an operator with exactly one function; same restriction as function class and in addition may only be placed in an operator record.

(Since "operator" is placed in "operator record" the enclosing scope is the operator record, so no need to add any additional restriction for extends.)

@modelica-trac-importer
Copy link
Collaborator Author

Comment by hansolsson on 17 Jun 2014 15:29 UTC
Spec group:
Agree and also change "Section Chapter 14" to "Chapter 14".

@modelica-trac-importer
Copy link
Collaborator Author

Comment by hansolsson on 18 Jun 2014 06:53 UTC
Resolved in r7690

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