Invalid collections returned when element type is not a class #1196
Labels
bug
This issue is a bug.
in-progress
Issue is being actively worked on.
language/java
Related to Java bindings
module/runtime
Issues affecting the `jsii-runtime`
p1
🐛 Bug Report
Affected Languages
TypeScript
orJavascript
Python
Java
C#
,F#
, ...)General Information
0.21.1 (build 9ff44cb), typescript 3.7.4
What is the problem?
When a return value is typed as a
List<SomeStruct>
, the Java runtime does not correctly perform the conversion to the correct Java type, and instead returns aList<JsiiObject>
where theJsiiObject
instances however contain all the information necessary to permit the conversion.The runtime needs to be corrected so that it actually returns a
List<SomeStruct>
, or else attempting to use the contents of the list is likely to cause aClassCastException
.It is probable the same issue would affect
Map<String, SomeStruct>
instances, so this has to be checked as well.Minimal Reproduction
A minimal reproduction using the AWS CDK can be achieved:
The text was updated successfully, but these errors were encountered: