Skip to content

Conversation

@madsodgaard
Copy link
Contributor

Adds support for importing Swift enums, including failable initializers, associated values, variables and methods.

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 progress, going well :)

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.

Looking very good so far! The caching needs rework but the rest is very nice work!

private func printNominalTypeThunks(_ printer: inout CodePrinter, _ type: ImportedNominalType) throws {
printHeader(&printer)

printJNICache(&printer, type)
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

return String(filePathPart.replacing(".swift", with: "+SwiftJava.swift"))
})
self.expectedOutputSwiftFiles.insert("\(translator.swiftModuleName)Module+SwiftJava.swift")
self.expectedOutputSwiftFiles.insert("\(translator.swiftModuleName)+JNICaches.swift")
Copy link
Collaborator

Choose a reason for hiding this comment

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

good, thx!

@ktoso
Copy link
Collaborator

ktoso commented Aug 15, 2025

Sorry about the conflict, you'll want to pick the wrapMemoryAddressUnsafe version

@madsodgaard madsodgaard changed the title WIP: [JExtract/JNI] Import enums [JExtract/JNI] Import enums Aug 16, 2025
@madsodgaard madsodgaard marked this pull request as ready for review August 16, 2025 10:00
@ktoso
Copy link
Collaborator

ktoso commented Aug 16, 2025

Looking good! Really great work with the Enums overall!

@ktoso ktoso merged commit f8de146 into swiftlang:main Aug 16, 2025
35 of 38 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.

2 participants