Skip to content

Finish the migration from ImportedTypeName over to TranslatedType#8

Merged
DougGregor merged 4 commits into
swiftlang:mainfrom
DougGregor:translated-type
Sep 27, 2024
Merged

Finish the migration from ImportedTypeName over to TranslatedType#8
DougGregor merged 4 commits into
swiftlang:mainfrom
DougGregor:translated-type

Conversation

@DougGregor
Copy link
Copy Markdown
Member

TranslatedType captures more information about how the type is represented in Swift, Java, and the intermediate stages in between. Migrate all remaining functionality from ImportedTypeName to TranslatedType.

Start resolving translated types through a centralized "lookup" mechanism rather than assuming that the types named in Swift are always going to have Java counterparts. For now, this means we won't try to translate functions that reference types that we don't know will be imported into Java. In the future, it means we'll be able to reason about these types to (e.g.) pass arguments and return values of those types correctly across the Swift/Java barrier.

TranslatedType captures more information about how the type is
represented in Swift, Java, and the intermediate stages in between.
When determining how to translate a Swift nominal type for Java, go
through the nominal lookup mechanism so we will (1) only find types
that we actually know about, rather than guessing, and (2) lazily form
the imported type record so we can handle seeing types out-of-order.
@DougGregor
Copy link
Copy Markdown
Member Author

@ktoso I'm going to go ahead and merge this, because I have a follow-up PR that benefits from being separate.

@DougGregor DougGregor merged commit 80b68a5 into swiftlang:main Sep 27, 2024
@DougGregor DougGregor deleted the translated-type branch September 27, 2024 22:31
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.

1 participant