Skip to content

jextract-swift support for Swift structs #26

Open
@DougGregor

Description

@DougGregor

At present, jextract-swift only exposes Swift classes to Java. We should also be able to expose Swift value types like structs and enums. We'll need to create a memory layout for the type on the Java side (which requires size/alignment) and will wrap the value type in a Java class. Destruction will require calls into the value witness table. If we want to implement the java.lang.Cloneable interface, we'll need to do so by calling the appropriate value witness to copy.

Anything we do here needs to start with getting access to the type metadata (we can use the mangled name of the witness table or its accessor for this), and the witness table from there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    jextract-swiftIssues related to jextract-swift

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions