Skip to content

jextract: introduce importedModuleStubs config#656

Merged
ktoso merged 1 commit into
swiftlang:mainfrom
ktoso:wip-importedModuleStubs
Mar 31, 2026
Merged

jextract: introduce importedModuleStubs config#656
ktoso merged 1 commit into
swiftlang:mainfrom
ktoso:wip-importedModuleStubs

Conversation

@ktoso
Copy link
Copy Markdown
Collaborator

@ktoso ktoso commented Mar 31, 2026

This is mostly a workaround for not handling cross module types yet, but it's good enough to unblock some use-cases so going with this for now.

It allows to tell jextract that "pretend there's a type like that" in that other "known module" -- similar to like we teach it about Data in Foundation.

This is also necessary when such types may have been declared inside an #if -- until we implement #633 properly

I'll follow up eventually with real cross module handling, but this stubs approach is useful by itself as well.

This is mostly a workaround for not handling cross module types yet, but
it's good enough to unblock some use-cases so going with this for now.

It allows to tell jextract that "pretend there's a type like that" in
that other "known module" -- similar to like we teach it about Data in
Foundation.

add some tests
@ktoso ktoso merged commit aee3122 into swiftlang:main Mar 31, 2026
61 checks passed
@ktoso ktoso deleted the wip-importedModuleStubs branch March 31, 2026 00:50
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