Skip to content
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

(rosetta) C# codegen issues #3026

Closed
rix0rrr opened this issue Oct 5, 2021 · 1 comment · Fixed by #3047
Closed

(rosetta) C# codegen issues #3026

rix0rrr opened this issue Oct 5, 2021 · 1 comment · Fixed by #3047
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@rix0rrr
Copy link
Contributor

rix0rrr commented Oct 5, 2021

🐛 Bug Report

Anonymous object literals get variable named as __object.

================= 7fbf857fd1de77d132905edb0484ed62d5d56ab4fe814ae1a79d0bf91aa83f57 =================
const expected = {
  Foo: 'Bar',
  Baz: 5,
  Qux: [ 'Waldo', 'Fred' ],
};
template.hasResourceProperties('Foo::Bar', expected);
----------- csharp -----------
__object expected = new Dictionary<string, object> {
    { "Foo", "Bar" },
    { "Baz", 5 },
    { "Qux", new [] { "Waldo", "Fred" } }
};
template.HasResourceProperties("Foo::Bar", expected);
@rix0rrr rix0rrr added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 5, 2021
rix0rrr added a commit that referenced this issue Oct 8, 2021
The error was in conflating "detecting a map type but not knowing
what the element type was" and "not detecting a map type" (these
cases could not be distinguished because both would result in
`undefined`).

Also remove an unnecessary argument to
`keyValueObjectLiteralExpression`.

Fixes #3026.
mergify bot pushed a commit to aws/aws-cdk that referenced this issue Oct 11, 2021
)

Rosetta automatic snippet translation is doing a poor
job of snippet translation. This is mainly because the
snippets are not compilable.

Update snippets to make them compilable and translate
correctly.

Additionally, make the rosetta compilation strict and run
during the build step.

There are still a few more translation errors, but these are
arising from bugs in rosetta.
aws/jsii#3026
aws/jsii#3029

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@mergify mergify bot closed this as completed in #3047 Oct 11, 2021
mergify bot pushed a commit that referenced this issue Oct 11, 2021
)

(The diff of this PR will clean up after #3044 has been merged)

The error was in conflating "detecting a map type but not knowing
what the element type was" and "not detecting a map type" (these
cases could not be distinguished because both would result in
`undefined`).

Also remove an unnecessary argument to
`keyValueObjectLiteralExpression`.

Fixes #3026, fixes #3027.


---

By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license].

[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
@github-actions
Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this issue Feb 21, 2022
…#16801)

Rosetta automatic snippet translation is doing a poor
job of snippet translation. This is mainly because the
snippets are not compilable.

Update snippets to make them compilable and translate
correctly.

Additionally, make the rosetta compilation strict and run
during the build step.

There are still a few more translation errors, but these are
arising from bugs in rosetta.
aws/jsii#3026
aws/jsii#3029

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant