You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
due to migrating my existing application from Xcode-11 to Xcode-12. I am facing following issue issue in ReactiveSwift.
completed = Signal.merge(cancelled, finalized)
Cannot assign value of type 'Signal<() -> Value, Never>' to type 'Signal<Value, Never>' ---> here assign variable declaration is let completed: Signal<Value, Never>
Cannot convert value of type 'Signal<Value, Never>' to expected argument type 'Signal<() -> Value, Never>'
Provide suggestion how to resolve this issue to migrate ReactiveSwift from 4.0.0 -> 6.6.0
The text was updated successfully, but these errors were encountered:
@sandeep3090 We ran into a similar issue with our project going from Xcode 11 -> 12. This has to do with changes that Apple has made to type inference. For example, if you did something like:
letisBaldBaby=Property.combineLatest(hasHair, age).map{ hasHair, age inreturn !hasHair && age <3}
Then if you command click on isBaldBaby and show quick help, it'd give something like Property<() -> Bool>, instead of Property<Bool> as it would in Xcode 11. You can fix this by adding an explicit type definition to your variable. Sometimes I also had to add a return type to any maps, filters, etc. as well to help it along:
letisBaldBaby:Property<Bool>=Property.combineLatest(hasHair, age).map{ hasHair, age ->Boolinreturn !hasHair && age <3}
In your case, you'd want to add type annotations to cancelled, finallized, and completed until it resolves to the correct type. I definitely recommend using the quick help inspector in Xcode (in the right-sidebar when you click on a symbol) for this since it'll tell you the exact type that it is getting resolved to.
@jagdeep-manik I am faced same issue now it's resolved. I hop in you case "age" signal have invalid mapping. So correct that or show me your code for hasHair or age. I will resolve that mapping.
Correct signal look like let age = agesignal.completed.compactMap { somestateCancelled }
due to migrating my existing application from Xcode-11 to Xcode-12. I am facing following issue issue in ReactiveSwift.
completed = Signal.merge(cancelled, finalized)
Provide suggestion how to resolve this issue to migrate ReactiveSwift from 4.0.0 -> 6.6.0
The text was updated successfully, but these errors were encountered: