Commit 638b546
authored
fix(jsii-pacmak): underscore arguments conflict in Java (#5011)
The `_` identifier is treated as a keyword since Java 9, and we used to escape it to `__`.
The problem is that but it is somewhat likely that people will use `_, __, ___` as multiple indifferent arguments, and now the identifiers will conflict. We have to pick something else.
Ideally we would look at the surrounding argument names and pick something guaranteed to be unique, but unfortunately the code isn't quite structured that way so we'll pick something unlikely to collide instead. We escape it to `_under_` instead.
Changing from `__` -> `_under_` would be a breaking change if applied to public property names, but most likely this will be used for function parameters (unfortunately the code has been structured in such a way that property and parameter names are strongly tied together, in a way that would take more time to unwind than I care to invest right now), where it doesn't matter.
---
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.01 parent 2970397 commit 638b546
File tree
10 files changed
+193
-21
lines changed- packages
- jsii-calc
- lib/module2530
- test
- jsii-pacmak
- lib/targets
- dotnet
- test/generated-code/__snapshots__
- jsii-reflect/test/__snapshots__
10 files changed
+193
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
17 | 21 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17960 | 17960 | | |
17961 | 17961 | | |
17962 | 17962 | | |
| 17963 | + | |
| 17964 | + | |
| 17965 | + | |
| 17966 | + | |
| 17967 | + | |
| 17968 | + | |
| 17969 | + | |
| 17970 | + | |
| 17971 | + | |
| 17972 | + | |
| 17973 | + | |
| 17974 | + | |
| 17975 | + | |
| 17976 | + | |
| 17977 | + | |
| 17978 | + | |
| 17979 | + | |
| 17980 | + | |
| 17981 | + | |
| 17982 | + | |
| 17983 | + | |
| 17984 | + | |
| 17985 | + | |
| 17986 | + | |
| 17987 | + | |
| 17988 | + | |
| 17989 | + | |
| 17990 | + | |
| 17991 | + | |
| 17992 | + | |
17963 | 17993 | | |
17964 | 17994 | | |
17965 | 17995 | | |
| |||
19960 | 19990 | | |
19961 | 19991 | | |
19962 | 19992 | | |
19963 | | - | |
| 19993 | + | |
19964 | 19994 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
88 | 98 | | |
89 | 99 | | |
90 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
608 | 608 | | |
609 | 609 | | |
610 | 610 | | |
611 | | - | |
612 | | - | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
613 | 627 | | |
614 | 628 | | |
615 | 629 | | |
| |||
Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 45 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 18 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 39 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 13 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 11 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments