Error when bridging `mutable func` for an enum
Open
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 3.2k
- Forks
- 106
- Avg merge
- 6d 13h
- Merged PRs (30d)
- 1
Description
When trying to export the following code:
public enum Foo {
case something
case anotherthing
public mutating func applyMarketUpdate(_ update: String) { }
}
It fails with the following output:
/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/Experiments_Bridge.swift:77:12: error: 'mutating' is not valid on instance methods in classes
/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/Experiments_Bridge.swift:77:12: error: 'mutating' is not valid on instance methods in classes
/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/Experiments_Bridge.swift:264:16: error: cannot use mutating member on immutable value: 'peer_swift' is a 'let' constant
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 reproducing the Swift enum export with the mutating method shown in the issue, then inspect the generated Experiments_Bridge.swift at the reported error location. Confirm the generated bridge compiles for the enum case and that the reported mutating-method errors no longer occur.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100