swiftlang / swiftlang/swift-java
jextract closure support should not specialize () -> () and () -> T shapes, and just use Runnable and Supplier
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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