-
Notifications
You must be signed in to change notification settings - Fork 245
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
Implementing an interface from Java does not work #1003
Comments
The interface implementation needs to inherit from Additionally, the constructor should look like: public MyMachineImage() {
super(InitializationMode.JSII);
JsiiEngine.getInstance().createNewObject(this);
} However even when adding this, it does not work (and it registers a number of overrides it shouldn't be registering). There appears to be a bug in that interface discovery is not performed at all here... |
Actually - scratch the previous comment about having to descend from |
Also it looks this bug can only trigger because of the presence of another bug (which has already been fixed, but is yet to release). |
When moving out of callbacks, the result was not turned into a reference before being passed out to the jsii kernel, causing TypeErrors when attempting to turn structs (and probably other non-primitive types) to JSON. Discovered while attempting to reproduce #1003, which can no longer trigger as it depended on returning a Struct through and `any` and being hit with the bug fixed in #997... the fix also removed the conditions that make leveraging the cause possible (or at the very least I could not come up with a reproduction, and have verified that the original bug report no longer reproduces once #997 is in). That being said, still introduced the necessary changes to address the cause by properly discovering interfaces and adding the relevant overrides filtering, as this may improve the performance and reliability of the jsii runtime for Java. Fixes #1003
When moving out of callbacks, the result was not turned into a reference before being passed out to the jsii kernel, causing TypeErrors when attempting to turn structs (and probably other non-primitive types) to JSON. Discovered while attempting to reproduce #1003, which can no longer trigger as it depended on returning a Struct through and `any` and being hit with the bug fixed in #997... the fix also removed the conditions that make leveraging the cause possible (or at the very least I could not come up with a reproduction, and have verified that the original bug report no longer reproduces once #997 is in). That being said, still introduced the necessary changes to address the cause by properly discovering interfaces and adding the relevant overrides filtering, as this may improve the performance and reliability of the jsii runtime for Java. Fixes #1003
Confirming this is fixed in |
* fix(python): correctly handle structs out of callbacks When moving out of callbacks, the result was not turned into a reference before being passed out to the jsii kernel, causing TypeErrors when attempting to turn structs (and probably other non-primitive types) to JSON. Discovered while attempting to reproduce #1003, which can no longer trigger as it depended on returning a Struct through and `any` and being hit with the bug fixed in #997... the fix also removed the conditions that make leveraging the cause possible (or at the very least I could not come up with a reproduction, and have verified that the original bug report no longer reproduces once #997 is in). That being said, still introduced the necessary changes to address the cause by properly discovering interfaces and adding the relevant overrides filtering, as this may improve the performance and reliability of the jsii runtime for Java. Fixes #1003 * improve documentation & test coverage * fixup * inline-fy doc * remove spurious 'final' * Add missing fget * add type annotation to make MyPy happy
🐛 Bug Report
Affected Languages
TypeScript
orJavascript
Python
Java
C#
,F#
, ...)General Information
0.20.6
What is the problem?
Full repro: https://github.com/rix0rrr/jsii-test-drive/tree/master/java/implement-interface
Verbose Log
The text was updated successfully, but these errors were encountered: