Error when bridging a protocol that implements Codable
Open
Nobody has claimed this yet.
bug
fuse
- Dominant language
- Swift
- Stars
- 3.2k
- Forks
- 106
- Avg merge
- 6d 13h
- Merged PRs (30d)
- 1
Description
Skip fails to generate JNI bindings for a hierarchy of protocols. I could isolate the issue and you can find a reproducible project here: protocols-errors.zip.
Error message looks something like this:
/Users/piercifani/Desktop/skip-errors/protocols-errors/travel-posters-model/.build/plugins/outputs/travel-posters-model/TravelPostersModel/destination/skipstone/TravelPostersModel/build/swift/plugins/outputs/swift/TravelPostersModel/destination/skipstone/SkipBridgeGenerated/Protocols_Bridge.swift:179:20: error: type 'UserDisplayable_BridgeImpl' does not conform to protocol 'Decodable'
/Users/piercifani/Desktop/skip-errors/protocols-errors/travel-posters-model/.build/plugins/outputs/travel-posters-model/TravelPostersModel/destination/skipstone/TravelPostersModel/build/swift/plugins/outputs/swift/TravelPostersModel/destination/skipstone/SkipBridgeGenerated/SceneApp_Bridge.swift:76:104: error: generic parameter 'ID' could not be inferred
/Users/piercifani/Desktop/skip-errors/protocols-errors/travel-posters-model/.build/plugins/outputs/travel-posters-model/TravelPostersModel/destination/skipstone/TravelPostersModel/build/swift/plugins/outputs/swift/TravelPostersModel/destination/skipstone/SkipBridgeGenerated/SceneApp_Bridge.swift:80:178: error: reference to member 'kotlincompat' cannot be resolved without a contextual type
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 with the reproducible project in protocols-errors.zip and run its build to reproduce the generated Swift errors. Inspect SkipBridgeGenerated/Protocols_Bridge.swift around UserDisplayable_BridgeImpl and SceneApp_Bridge.swift around the reported lines. Done means the protocol hierarchy implementing Codable generates valid JNI bindings and the project builds without these errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100