swiftlang / swiftlang/swift-java
Consider @JExtract swift attribute to control jextract behavior
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 1.2k
- Forks
- 123
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 16
Description
Some behaviors of jextract may be useful to configure on a decl by decl basis.
For example, we might want to say JExtract(as: .javaLong) var int: UInt32 which would then apply the "widen" conversion when extracting this integer to a getter/setter in Java (void setInt(long value)) in order to support the unsigned positive range of those numbers.
This has the downside of having to modify the Swift sources but may be nice for some developers.
The same attribute should be usable for other extract behavior changes like renaming etc.
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 reading the jextract implementation and its handling of Swift declarations and extraction behavior. Determine how an @JExtract attribute could configure widening and renaming on individual declarations, then define tests showing those options affect the generated Java API.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100