Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow "create" to specify additional interfaces #818

Closed
RomainMuller opened this issue Sep 24, 2019 · 0 comments · Fixed by #825
Closed

Allow "create" to specify additional interfaces #818

RomainMuller opened this issue Sep 24, 2019 · 0 comments · Fixed by #825
Assignees
Labels
effort/large Large work item – several weeks of effort feature-request A feature should be added or improved. module/kernel Issues affecting the `jsii-kernel` module

Comments

@RomainMuller
Copy link
Contributor

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.

@RomainMuller RomainMuller added the module/kernel Issues affecting the `jsii-kernel` module label Sep 24, 2019
@RomainMuller RomainMuller self-assigned this Sep 24, 2019
@RomainMuller RomainMuller added the effort/large Large work item – several weeks of effort label Sep 24, 2019
@RomainMuller RomainMuller added feature-request A feature should be added or improved. jsii/🚀/apollo labels Oct 4, 2019
@mergify mergify bot closed this as completed in #825 Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/large Large work item – several weeks of effort feature-request A feature should be added or improved. module/kernel Issues affecting the `jsii-kernel` module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant