swiftlang / swiftlang/swift-java
Support tuple returns from dictionaries
Open
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 1.2k
- Forks
- 123
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 16
Description
Today we skip those, thanks to https://github.com/swiftlang/swift-java/pull/750, as they may cause errors like:
ObertonWalletCore/destination/JExtractSwiftPlugin/Sources/BindingStore+SwiftJava.swift:24:41: error: type 'BindingStore.RawResponse' (aka '(requestId: UInt32, stringResponse: String, responseType: TSDKBindingResponseType, finished: Bool)') cannot conform to 'JavaBoxable' [#ProtocolTypeNonConformance]
22 | @_cdecl("Java_com_custwallet_core_BindingStore__00024getCompleteResponses__")
23 | public func Java_com_custwallet_core_BindingStore__00024getCompleteResponses__(environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass) -> jlong {
24 | return BindingStore.completeResponses.dictionaryGetJNIValue(in: environment)
| |- error: type 'BindingStore.RawResponse' (aka '(requestId: UInt32, stringResponse: String, responseType: TSDKBindingResponseType, finished: Bool)') cannot conform to 'JavaBoxable' [#ProtocolTypeNonConformance]
| `- note: only concrete types such as structs, enums and classes can conform to protocols
25 | }
Because the tuple cannot conform to JavaBoxable. We could find some way to support these?
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 reviewing the dictionaryGetJNIValue call in ObertonWalletCore/destination/JExtractSwiftPlugin/Sources/BindingStore+SwiftJava.swift and the context from pull request #750. Determine how tuple returns should be represented for JavaBoxable, then verify that dictionary returns containing tuples no longer produce the reported protocol-conformance error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, swift
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100