Skip to content

Allow "create" to specify additional interfaces #818

@RomainMuller

Description

@RomainMuller

The kernel's create (and the private objects.register) call only requires the caller to specify a single fqn (that of the base type, which can be Object if nothing better is available). Unfortunately, this means that instances that implement one or more interface not inherited from a Javascript base class, the type information for interface members is lost when crossing the language boundary. This in turns causes all method arguments and return types to be inferred as any, further preventing type information from being available. This has been found to cause issues such as #807.

In order to address this, the kernel needs to allow the caller to also specify a list of implemented interfaces, so that it is able to access type information for members that are override in the foreign language. This is also useful when a client sub-classes a jsii type and adds new interface implementations to it, since that allows the type information for those to become available, too.

Metadata

Metadata

Assignees

Labels

effort/largeLarge work item – several weeks of effortfeature-requestA feature should be added or improved.module/kernelIssues affecting the `jsii-kernel` module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions