Closed omarzl closed 1 month ago
Yes, the subscript was always a bit of a hack, so they disabled in Swift 6 and now you should use .modify
.
Got it! I changed to:
await store.send(\.destination.addContact.setName, "Blob Jr.") {
$0.destination?.modify(\.addContact) { $0.contact.name = "Blob Jr." }
}
And added support in the enum to CasePathable
:
extension ContactsFeature {
@CasePathable
@Reducer(state: .equatable)
enum Destination {
case addContact(AddContactFeature)
case alert(AlertState<ContactsFeature.Action.Alert>)
}
}
Thanks!
Description
Error presented when writing a line in a test:
$0.destination?.addContact?.contact.name = "Blob Jr."
after following the tutorial https://pointfreeco.github.io/swift-composable-architecture/main/tutorials/composablearchitecture/02-03-testingpresentationReproduced using Xcode 16 Beta 2 / Swift 6
Checklist
main
branch of this package.Expected behavior
That the code compiles
Actual behavior
This code isn't compiling:
Showing this error:
Steps to reproduce
No response
The Composable Architecture version information
54eb417
Destination operating system
iOS 18
Xcode version information
Version 16.0 beta 2 (16A5171r)
Swift Compiler version information