I'm testing the Opaque Result Types with the toolchain: Swift 5.1 Snapshot 2019-05-03 (a)
And I get the following error when I try to assign to a property an Opaque type.
Cannot assign value of type 'some SaveAddress' to type 'some SaveAddress'
Do the opaque types can only be assigned to a local variable or it's a feature that's under development?
protocol UseCase {
associatedtype Input
associatedtype Output
func execute(_ input: Input) -> Output
}
struct SignUpAddressData {
}
protocol SaveAddress : UseCase {
func execute(_ input: SignUpAddressData) -> Void
}
func bindSaveAddress() -> some SaveAddress {
return SaveAddressDefault()
}
class SaveAddressDefault: SaveAddress {
func execute(_ input: SignUpAddressData) {
}
}
class InputPersonalDataViewModel {
private let saveAddress: some SaveAddress
init() {
self.saveAddress = bindSaveAddress()
}
}