Skip to content

Clarify the kinds of instance members in specification documents #3413

@eernstg

Description

@eernstg

We have several kinds of members associated with the word 'instance':

  • Instance getters, setters, and methods, declared in a class, mixin class, mixin, or enum declaration.
  • Instance getters, setters, and methods, declared in an extension declaration.
  • Instance getters, setters, and methods, declared in an extension type declaration.

The difference matters in several situations: The first kind are subject to object-oriented dispatch (late binding), and hence they must have a correct override relationship to each other in a superclass chain. The other two kinds are statically resolved, and there is no constraint that corresponds to the 'correct override' relationship.

Next, it is exactly the ones that are subject to OO dispatch that support covariant parameters.

The language specification, and probably several other specification documents, are not always fully explicit about this distinction.

This issue serves as a reminder that we should be more explicit. For example, the current specification of which parameters can be covariant-by-declaration fails to say that it is only supported for dispatched instance methods.

Metadata

Metadata

Assignees

No one assigned

    Labels

    specificationtechnical-debtDealing with a part of the language which needs clarification or adjustments

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions