Skip to content
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

Redeclare operations from RACStream with more precise ValueType #39

Merged
merged 2 commits into from
Nov 19, 2016

Conversation

erichoracek
Copy link
Contributor

Since the operations built on RACStream primitives have an instancetype return value, the compiler assumes that they inherit the receiving signal’s ValueType when they are invoked on RACSignal. For operators like map:, this is almost always an incorrect assumption. As such, in cases where the ValueType of the result of the operation is not able to be inferred, the ValueType is erased in the result by returning RACSignal * with no ValueType information.

Additionally, in cases where instancetype is a valid return type and no more precise ValueType information could be added to the method signature, the operation is not redeclared, since the compiler will assume the correct return types.

Finally, in cases where more precise type information could be provided, the operators are redeclared as such.

…ValueType information

Since the operations built on RACStream primitives have an `instancetype` return value, the compiler assumes that they inherit the receiving signal’s `ValueType`. For operators like `map:`, this is almost always an incorrect assumption. As such, in cases where the `ValueType` of the result of the operation is not able to be inferred, the `ValueType` is erased in the result by returning `RACSignal *` with no `ValueType` information.

Additionally, in cases where `instancetype` is a valid return type and no more precise `ValueType` information could be added to the method signature, the operation is not redeclared, since the compiler will assume the correct return type.

Finally, in cases where more precise type information could be provided, the operators are redeclared as such.
@mdiep mdiep merged commit 9b26865 into ReactiveCocoa:master Nov 19, 2016
byohay pushed a commit to byohay/ReactiveObjC that referenced this pull request Dec 14, 2021
…y-weak-var

RACDelegateProxy: change property from unsafe_unretained to weak.
stuartofmine pushed a commit to stuartofmine/ReactiveObjC_2023 that referenced this pull request Oct 18, 2023
Redeclare operations from RACStream with more precise ValueType
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants