Skip to content

Conversation

@rintaro
Copy link
Member

@rintaro rintaro commented Apr 15, 2025

Register all the files to Swift2JavaTranslator (and NominalTypeResolution) and analye() all the files at once.

Swift2JavaVisitor.visit(_: ExtentionDeclSyntax) requires all the nominal types are prepared in the nominalResolution. Otherwise it's just ignored.

Also previously, writing files was performed for each file iteration but actually, it is not a per-source file operation. Instead, it only writes the current state of the translator, so multiple calls were redundant.

Register all the files to `Swift2JavaTranslator` (and
`NominalTypeResolution`) and `analye()` all the files at once.

`Swift2JavaVisitor.visit(_: ExtentionDeclSyntax)` requires all the
nominal types are prepared in the `nominalResolution`. Otherwise it's
just ignored.

Also previously, writing files happend for each file iteration but
actually, it is not a per-source file operation. Instead, it only writes
the current state of the translator.
Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

Ah, thank you! Might this fix #209?

Copy link
Collaborator

@ktoso ktoso left a comment

Choose a reason for hiding this comment

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

Nice, thank you

@rintaro rintaro merged commit d332703 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