-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(rosetta): literal map type is rendered as __object in C sharp (#3047
) (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
- Loading branch information
Showing
10 changed files
with
57 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/jsii-rosetta/test/translations/statements/initialize_object_literal.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
IDictionary<string, object> expected = new Dictionary<string, object> { | ||
{ "Foo", "Bar" }, | ||
{ "Baz", 5 }, | ||
{ "Qux", new [] { "Waldo", "Fred" } } | ||
}; |
4 changes: 4 additions & 0 deletions
4
packages/jsii-rosetta/test/translations/statements/initialize_object_literal.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Map<String, Object> expected = Map.of( | ||
"Foo", "Bar", | ||
"Baz", 5, | ||
"Qux", List.of("Waldo", "Fred")); |
5 changes: 5 additions & 0 deletions
5
packages/jsii-rosetta/test/translations/statements/initialize_object_literal.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
expected = { | ||
"Foo": "Bar", | ||
"Baz": 5, | ||
"Qux": ["Waldo", "Fred"] | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/jsii-rosetta/test/translations/statements/initialize_object_literal.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const expected = { | ||
Foo: 'Bar', | ||
Baz: 5, | ||
Qux: [ 'Waldo', 'Fred' ], | ||
}; |