swiftlang / swiftlang/swift-java

jextract closure support should not specialize () -> () and () -> T shapes, and just use Runnable and Supplier

Open
#811 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature:jextract
Dominant language
Swift
Stars
1.2k
Forks
123
Avg merge
1d 7h
Merged PRs (30d)
16

Description

That's idiomatic Java types to use for these situations and we can save ourselves some codegen by doing so.

So when we see

func test(a: () -> ()) 

We should make that Runnable rather than generate an one-off type for this.

The same for Supplier probably

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating jextract's closure-shape handling and the codegen for () -> () and () -> T. Compare the generated types with Java's Runnable and Supplier, then verify that the example closure signatures use those types without generating one-off interfaces.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, swift
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.