swiftlang / swiftlang/swift-java
wrap-java: Generated @JavaInterfaces must have JavaObject base functions
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 1.2k
- Forks
- 123
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 16
Description
The way we're generating Swift types for interfaces is problematic:
@JavaInterface("java.lang.reflect.TypeVariable", extends: Type.self)
public struct TypeVariable<D: AnyJavaObject> {
@JavaMethod
public func getGenericDeclaration() -> GenericDeclaration!
@JavaMethod
public func getAnnotatedBounds() -> [AnnotatedType?]
while we know we can call hashCode, equals and toString on those types... Lack of those on extracted types means we can't make ALL java types Hashable, which makes interfaces hard to work with -- and since a lot of java is interface based, that's not ideal.
It also makes our description->toString problematic.
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 in the wrap-java generation path responsible for Swift interface types such as TypeVariable. Trace how generated interfaces represent JavaObject behavior and determine how hashCode, equals, and toString should be exposed; done means generated interfaces provide those base functions and support the intended Hashable use.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, swift
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100