Skip to content

Make nested classes explicitly-specifiable and work through some integration issues #118

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

Merged
merged 10 commits into from
Oct 27, 2024

Conversation

DougGregor
Copy link
Member

@DougGregor DougGregor commented Oct 26, 2024

Implement a follow-on to #115 that improves things in a few ways:

  • Allow Java2Swift.config to explicitly specify nested classes, or omit them to get them autogenerated. This "moved" the recursion to make it computed by the outer Java2Swift rather than always walking through all nested classes.
  • Get the JavaSieve example working again, now with nested types being listed by the Jar file reader
  • More tests!
  • Deal with an annoying problem when importing Java nested classes named "Type"; it doesn't work well in Swift because X.Type already has a meaning.

@DougGregor
Copy link
Member Author

We're going to start with #115 and I'm going to rebase the few needed changes on top.

We're using the "normal" name now that uses $ for nested classes.
Rather than having the Java-to-Swift translator walking all nested
classes itself, provide it with the set of nested classes that should
be translated along with the enclosing class. This allows us to be
explicit about the naming of nested classes in the config file (where
we want to), while still getting the convenience of translating the
nested classes automatically for you by default.
…avaType"

This is deeply unfortunate, but we need compile-side fixes for
nested types named "Type" to work.
@DougGregor DougGregor force-pushed the java2swift-nested-classes branch from a94a5f6 to 968a580 Compare October 27, 2024 01:09
@DougGregor DougGregor changed the title Implemented nested classes for Java2Swift Make nested classes explicitly-specifiable and work through some integration issues Oct 27, 2024
@DougGregor DougGregor merged commit 97473d9 into swiftlang:main Oct 27, 2024
11 checks passed
@DougGregor DougGregor deleted the java2swift-nested-classes branch October 27, 2024 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants