-
Notifications
You must be signed in to change notification settings - Fork 246
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
can a diamond dependency be used #2256
Comments
Related to this is when a TS interface or class implements two interfaces that share a property/method with the same name and type. This will generate Java interfaces with default implementations for both and the compiler doesn't know which one to use. Re-declaring the implementation at the implementer level when there is a conflict will fix this. We saw this in aws/aws-cdk#12700. |
Needs reverting because of aws/jsii#2256 . This reverts commit 1a9f2a8. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Turns out the code is generated correctly for diamond dependencies, however what happens and probably cannot be supported in a safe way is when two upstream interfaces declare optional properties by the same name (and type, but this is already checked for). This can appear to happen with a diamond graph, if the interface that declares some optional property (and is inherited by a single child through multiple parents) is not exported... in such cases declarations are "promoted" to the extending classes as the internal interface is erased from the exported model. In any case - even though we could generate code that compiles, given a snapshot of a dependency graph, this cannot be made to be forward-compatible with addition of new a conflicting declaration in an extended dependency: the solution would be to "override" the |
…s#12832) Needs reverting because of aws/jsii#2256 . This reverts commit 1a9f2a8. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This is a re-submit of the PR aws#12700, which had to be reverted because of JSII issue aws/jsii#2256. Since that issue has been fixed in JSII version `1.23.0`, which is what we currently use, re-introduce the changes from that PR.
This is a re-submit of the PR #12700, which had to be reverted because of JSII issue aws/jsii#2256. Since that issue has been fixed in JSII version `1.23.0`, which is what we currently use, re-introduce the changes from that PR. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This is a re-submit of the PR #12700, which had to be reverted because of JSII issue aws/jsii#2256. Since that issue has been fixed in JSII version `1.23.0`, which is what we currently use, re-introduce the changes from that PR. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This is a re-submit of the PR #12700, which had to be reverted because of JSII issue aws/jsii#2256. Since that issue has been fixed in JSII version `1.23.0`, which is what we currently use, re-introduce the changes from that PR. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This is a re-submit of the PR aws#12700, which had to be reverted because of JSII issue aws/jsii#2256. Since that issue has been fixed in JSII version `1.23.0`, which is what we currently use, re-introduce the changes from that PR. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This is a re-submit of the PR #12700, which had to be reverted because of JSII issue aws/jsii#2256. Since that issue has been fixed in JSII version `1.23.0`, which is what we currently use, re-introduce the changes from that PR. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This issue has not received any attention in 2 years. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
❓ Guidance
Affected Languages
TypeScript
orJavascript
Python
Java
C#
,F#
, ...)General Information
The Question
Is it possible to use a diamond dependency if there are no conflicting (potentially duplicated) properties?
A recent CDK PR motivated this question where a construct was updated to declare interfaces in the following manner:
a simplified view of the interface declarations here looks like the following:
However there was a failure with the java code generation:
Is this something that we could support? If not, perhaps it's an opportunity to validate
The text was updated successfully, but these errors were encountered: