Skip to content

Inheritance of symbols from parent to child #23

@jamiebuilds

Description

@jamiebuilds

I have some questions about this example:

protocol A { a; }
protocol B extends A { b; }

class C implements B {
  [A.a]() {}
  [B.b]() {}
}

In this example, implementing B seems to require referencing A. I was wondering if it made sense to copy over the properties of A to B:

protocol A { a; }
protocol B extends A { b; }

class C implements B {
  [B.a]() {} // copy A.a to B.a
  [B.b]() {}
}

If not, does that mean that B can also have it's own symbol named a?

protocol A { a; }
protocol B extends A { a; b; }

class C implements B {
  [A.a]() {}
  [B.a]() {}
  [B.b]() {}
}

Or should that be an early error?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Agenda+To be discussed in next breakout. Remove when actually discussed and resolved.needs consensus

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions