Skip to content

fix(kernel): Correctly return instances of un-exported types#321

Merged
RomainMuller merged 2 commits intomasterfrom
rmuller/bug-320
Nov 26, 2018
Merged

fix(kernel): Correctly return instances of un-exported types#321
RomainMuller merged 2 commits intomasterfrom
rmuller/bug-320

Conversation

@RomainMuller
Copy link
Copy Markdown
Contributor

@RomainMuller RomainMuller commented Nov 26, 2018

When an un-exported type that extends an exported type is returned with
an interface as the declared type, the JSII kernel used to return a ref
with the FQN of the exported supertype, instead of correctly wrapping
the instance in a proxy of the interface type as it should have.

Fixes #320

This test covers the behavior of the JSII runtimes when a method is
declared to return an interface type, and returns an instance of a
private (un-exported) type that implements the interface while extending
an exported type. This has been seen to cause issues in the Java
runtime, for example, as the JSII kernel will return an ObjID with a
type fragment that refers to the exported super-class, and not the
interface type.
When an un-exported type that extends an exported type is returned with
an interface as the declared type, the JSII kernel used to return a ref
with the FQN of the exported supertype, instead of correctly wrapping
the instance in a proxy of the interface type as it should have.

Fixes #302
@RomainMuller RomainMuller changed the title chore: Add compliance test around #320 fix(kernel): Correctly return instances of un-exported types Nov 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants