New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ambiguous use of distinctUntilChanged #70
Comments
Your best option is probably to use https://github.com/ReactiveCocoa/ReactiveObjCBridge/ with https://github.com/ReactiveCocoa/ReactiveSwift/ |
@mdiep Thanks for the comment. I'm currently migrating to Swift 3 and that's the main reason for this errors. Still, it must be done. The problem of using ReactiveObjcBridge + ReactiveSwift is the boilerplate of bridging we will have in the code. A lot of our swift code is exposed to Objective-C and that already sucks. It could make sense to migrate everything to swift in the near future. Meanwhile, I found that adding the explicit type seems to work. I still don't understand why it can infer the correct type since the RACObserve function returns a RACSignal type. Regarding RACStream it does not implement lightweight generics. Is there a reason for it ? BR, |
/cc @erichoracek |
I have divided the several signals to understand where the ambiguity occurs:
Even by explicitly indicating the RACSignal type the compiler still founds it ambiguous. |
This appears to be due to a Swift compiler issue that results from a method being declared both on a non-generic base class (
The second option appears to be the most preferable, since that leaves As such, unless anyone knows of any issues, I'll go ahead and make a PR with the second option. |
Fixes #70 Swift is unable to disambiguate between methods declared both on a non-generic base class and a generic subclass.
Integrates ReactiveCocoa#71, fixing ReactiveCocoa#70
@vitorhugomagalhaes please try 2.1.2 and make sure it resolves your issue. Let me know if it doesn't—thanks! |
@erichoracek Thanks. I will test the new version and get back to you asap. |
I've filed this issue as https://bugs.swift.org/browse/SR-3529 |
Fixes ReactiveCocoa#70 Swift is unable to disambiguate between methods declared both on a non-generic base class and a generic subclass.
Integrates ReactiveCocoa#71, fixing ReactiveCocoa#70
Hi,
The following code is causing an ambiguous error:
The utility class I'm using to bridge RACObserve is:
Is there any way to workaround this ? I cannot use the pure Swift version for now.
Thanks in advance,
The text was updated successfully, but these errors were encountered: