[SR-9893] Swift 5 regression: cannot assign through '!': '$0' is immutable #52299
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
regression
source compatibility
swift 5.0
Environment
Xcode Version 10.2 beta 2
Swift 5 toolchain 06/02/2019
macOS 10.14.3 (18D109)
Additional Detail from JIRA
md5: ac90bc1287842cec66ca4d2c3e628f0b
Issue Description:
I have a test which won't compile with the Swift 5 compiler (2019-02-06 snapshot), both in Swift 5 and Swift 4.2 modes:
The compiler emits the following error:
The error vanishes when the code is rewritten in the equivalent form below:
For information, the record1, record2 variables are of type `Item`, and the fetchedRecords variable is of type `[Item]`:
To reproduce:
1. Clone https://github.com/groue/GRDB.swift.git
2. Checkout the 493575a47bc7feffecd91bdd411358e15f92e118 commit
3. Open GRDB.xcworkspace
4. Select the GRDBOSX scheme
5. Build tests with the 2019-02-06 snapshot
> there is an error :(6. Build tests with Xcode 10.1
> there is no error :)The text was updated successfully, but these errors were encountered: