Skip to content

Name clashes during inheritance #97

Description

@markusvoelter

Name-clash problem as described in section 3.3

Example: concept X inherits from concepts A and B who both define a feature named f

classDiagram

class A {
  string f
}

class B {
  string f
}

A <|-- X
B <|-- X
Loading

Decisions:

  • we treat A.f and B.f as distinct f's in X (semantically they are different)
  • remaining issue: who can continue to use the name f, because the name (not the feature) is ambiguous (relevant for situations where we access f by name and not by key; ie., generated code)
  • solve the problem for the place where we use by-name reference, aka the code
  • generator that produces said code must rename one of them (i.e. 3.3.3. Require qualification)
    • potentially user-guided somehow (e.g. by annotations on X; close to 3.3.2. Rename conflicting names)
    • or automated
    • implementation detail of the API generator
  • the alternative of merging is stupid because we imply semantics in a name (i.e. 3.3.1. Merge compatible names)
  • disallowing conflicts is unrealistic in the face of reuse of metamodels (i.e. 3.3.4. Disallow conflicts)
  • our solution might lead to ugly names, but since the situation is rare in the first place we consider this acceptable

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions