Skip to content

Erase non-exported base classes #417

Closed
@eladb

Description

@eladb

If an exported class extends a non-exported class, it should be possible to erase the non-exported class from the public API by copying it's interface to the derived class. This is allowed in TypeScript and there is no reason it won't be allowed in jsii.

The compiler should respect any public bases of the erased class and copy those as well to the derived class.

This is already supported for interfaces.

Repro:

export class PublicBaseOfBase {
  public foo() { }
}

class PrivateBase extends PublicBaseOfBase {
  public goo() { }
}

export class Derived extends PrivateBase {
  public noo() { }
}

After erasure, the API of Derived should be:

class Derived extends PublicBaseOfBase {
  public goo() { }
  public noo() { }
}

Metadata

Metadata

Assignees

Labels

effort/smallSmall work item – less than a day of effort

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions