test(rosetta): Extend submodule import test case for nested structs in submodules#4056
test(rosetta): Extend submodule import test case for nested structs in submodules#4056
Conversation
|
|
||
| // Accesses two distinct points of the submodule hierarchy | ||
| var myClass = new Submodule.MyClass(new SomeStruct { Prop = Submodule.Child.SomeEnum.SOME }); | ||
| var myClass = new Submodule.MyClass(new SomeStruct { Prop = Submodule.Child.SomeEnum.SOME, NestedStruct = new Submodule.Child.AnotherStruct { StringProperty = "hello" } }); |
There was a problem hiding this comment.
While looking at this once more, I noticed that the original test already seems to have a small error, too:
| var myClass = new Submodule.MyClass(new SomeStruct { Prop = Submodule.Child.SomeEnum.SOME, NestedStruct = new Submodule.Child.AnotherStruct { StringProperty = "hello" } }); | |
| var myClass = new Submodule.MyClass(new Submodule.Child.SomeStruct { Prop = Submodule.Child.SomeEnum.SOME, NestedStruct = new Submodule.Child.AnotherStruct { StringProperty = "hello" } }); |
| NestedStruct: &AnotherStruct{ | ||
| stringProperty: jsii.String("hello"), | ||
| }, |
|
|
||
| # Accesses two distinct points of the submodule hierarchy | ||
| my_class = calc.submodule.MyClass(prop=calc.submodule.child.SomeEnum.SOME) | ||
| my_class = calc.submodule.MyClass(prop=calc.submodule.child.SomeEnum.SOME, nested_struct=calc.submodule.child.AnotherStruct(string_property="hello")) |
|
@DanielMSchmidt just pointed me at https://github.com/aws/jsii-compiler which is where JSII 5.0 lives – I'll create a new PR over there as we're on JSII 5.0 now 😄 Edit: I'll create it in https://github.com/aws/jsii-rosetta of course 😄 |
|
Hm, I could use some help there – it seems like |
|
@ansgarm the The If |
fc24685 to
2919522
Compare



Hi! I created this (failing) test case for a jsii-rosetta problem we are seeing in
cdktf convert(bullet point # 2 in this comment).Originally we uncovered that this code was invalid for Python but upon writing this test case, I think it is also producing invalid code for C# and Go. I'm not entirely sure whether I've adjusted the expected results in the right way, though. I'll add comments to those places including what Rosetta currently returns to make it easier to see how these tests currently fail.
I'd be open to contribute to a solution but I'm having a hard time even describing the problem in the right terms 😅
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.