Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a runtime mapping from Java canonical class names to their equivalent Swift types #15

Open
DougGregor opened this issue Sep 30, 2024 · 0 comments

Comments

@DougGregor
Copy link
Member

When we have a Swift type that wraps a Java class, it has a macro annotation like this:

@JavaClass("java.lang.Object")
struct JavaObject { ... }

Given the type JavaObject on the Swift side, we can query the AnyJavaObject conformance to get the canonical Java class name. However, we have no way to go in the opposite direction, from a Java class name like java.lang.Object to JavaObject. The translation manifest has this information for use in the tool, but at runtime there is no way say "find the most specific Swift type for this Java object".

We should consider some kind of automatically-populated runtime registry to make this possible.

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

No branches or pull requests

1 participant