Skip to content

Conversation

@rintaro
Copy link
Member

@rintaro rintaro commented Apr 15, 2025

  • Introduce Swift2JavaVisitor.typeContext to handle nested types
  • Unify shouldImport(log:) method using WithModifiersSyntax & WithAttributesSyntax
  • Unify accessControlModifiers as an extention to WithModifiersSyntax
  • Import open declarations
  • Don't import JavaKit declarations. e.g. @JavaClass
  • Don't import non-public variable decls.
  • Introduce DeclSyntaxProtocol.qualifiedNameForDebug and use it for log messages
  • Introduce DeclSyntaxProtocol.signatureString and use it as the snippet in the exported .java files.

* Introduce `Swift2JavaVisitor.typeContext` to handle nested types
* Unify `shouldImport(log:)` method using `WithModifiersSyntax &
  WithAttributesSyntax`
* Unify `accessControlModifiers` as an extention to `WithModifiersSyntax`
* Don't import `JavaKit` declarations. e.g. `@JavaClass`
* Don't import non-public variable decls.
* Introduce `DeclSyntaxProtocol.qualifiedNameForDebug` and use it for
  log messages
* Introduce `DeclSyntaxProtocol.signatureString` and use it as the
  snippet in the exported `.java` files.
fatalError("unimplemented \(self.kind)")
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That’s neat, thanks!


var currentType: ImportedNominalType? = nil
/// Type context stack associated with the syntax.
var typeContext: [(syntaxID: Syntax.ID, type: ImportedNominalType)] = []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thank you!

@rintaro rintaro merged commit 0b1fc44 into swiftlang:main Apr 16, 2025
12 checks passed
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.

3 participants