-
Notifications
You must be signed in to change notification settings - Fork 247
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
test(rosetta): Extend submodule import test case for nested structs in submodules #4056
base: main
Are you sure you want to change the base?
Conversation
@@ -9,7 +9,7 @@ | |||
}); | |||
|
|||
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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"), | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -9,7 +9,7 @@ | |||
) | |||
|
|||
# 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")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.