Skip to content

Commit

Permalink
Merge pull request #129 from ReactiveCocoa/xcode9-prototype-issue-fix
Browse files Browse the repository at this point in the history
Xcode9 prototype issue fix
  • Loading branch information
andersio authored Dec 30, 2017
2 parents 1ce5316 + d7263d0 commit eeaaefa
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 11 deletions.
4 changes: 2 additions & 2 deletions ReactiveObjC/RACSequence.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ typedef RACSequence * _Nullable (^RACSequenceBindBlock)(ValueType _Nullable valu
/// return value must be an object. This argument cannot be nil.
///
/// Returns a new sequence of reduced tuple values.
- (RACSequence *)reduceEach:(id _Nullable (^)())reduceBlock;
- (RACSequence *)reduceEach:(RACReduceBlock)reduceBlock;

/// Returns a sequence consisting of `value`, followed by the values in the
/// receiver.
Expand Down Expand Up @@ -309,7 +309,7 @@ typedef RACSequence * _Nullable (^RACSequenceBindBlock)(ValueType _Nullable valu
///
/// Returns a new sequence containing the results from each invocation of
/// `reduceBlock`.
+ (RACSequence<ValueType> *)zip:(id<NSFastEnumeration>)sequences reduce:(id _Nullable (^)())reduceBlock;
+ (RACSequence<ValueType> *)zip:(id<NSFastEnumeration>)sequences reduce:(RACReduceBlock)reduceBlock;

/// Returns a sequence obtained by concatenating `sequences` in order.
+ (RACSequence<ValueType> *)concat:(id<NSFastEnumeration>)sequences;
Expand Down
3 changes: 2 additions & 1 deletion ReactiveObjC/RACSignal+Operations.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ extern const NSInteger RACSignalErrorNoMatchingCase;
///
/// Returns a signal which sends the results from each invocation of
/// `reduceBlock`.
+ (RACSignal<ValueType> *)combineLatest:(id<NSFastEnumeration>)signals reduce:(ValueType _Nullable (^)())reduceBlock RAC_WARN_UNUSED_RESULT;
+ (RACSignal<ValueType> *)combineLatest:(id<NSFastEnumeration>)signals reduce:(RACGenericReduceBlock)reduceBlock RAC_WARN_UNUSED_RESULT;


/// Merges the receiver and the given signal with `+merge:` and returns the
/// resulting signal.
Expand Down
2 changes: 1 addition & 1 deletion ReactiveObjC/RACSignal+Operations.m
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ + (RACSignal *)combineLatest:(id<NSFastEnumeration>)signals {
}] setNameWithFormat:@"+combineLatest: %@", signals];
}

+ (RACSignal *)combineLatest:(id<NSFastEnumeration>)signals reduce:(id (^)())reduceBlock {
+ (RACSignal *)combineLatest:(id<NSFastEnumeration>)signals reduce:(RACGenericReduceBlock)reduceBlock {
NSCParameterAssert(reduceBlock != nil);

RACSignal *result = [self combineLatest:signals];
Expand Down
4 changes: 2 additions & 2 deletions ReactiveObjC/RACSignal.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ typedef RACSignal * _Nullable (^RACSignalBindBlock)(ValueType _Nullable value, B
/// return value must be an object. This argument cannot be nil.
///
/// Returns a new signal of reduced tuple values.
- (RACSignal *)reduceEach:(id _Nullable (^)())reduceBlock RAC_WARN_UNUSED_RESULT;
- (RACSignal *)reduceEach:(RACReduceBlock)reduceBlock RAC_WARN_UNUSED_RESULT;

/// Returns a signal consisting of `value`, followed by the values in the
/// receiver.
Expand Down Expand Up @@ -268,7 +268,7 @@ typedef RACSignal * _Nullable (^RACSignalBindBlock)(ValueType _Nullable value, B
///
/// Returns a new signal containing the results from each invocation of
/// `reduceBlock`.
+ (RACSignal<ValueType> *)zip:(id<NSFastEnumeration>)signals reduce:(id _Nullable (^)())reduceBlock RAC_WARN_UNUSED_RESULT;
+ (RACSignal<ValueType> *)zip:(id<NSFastEnumeration>)signals reduce:(RACGenericReduceBlock)reduceBlock RAC_WARN_UNUSED_RESULT;

/// Returns a signal obtained by concatenating `signals` in order.
+ (RACSignal<ValueType> *)concat:(id<NSFastEnumeration>)signals RAC_WARN_UNUSED_RESULT;
Expand Down
10 changes: 8 additions & 2 deletions ReactiveObjC/RACStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ NS_ASSUME_NONNULL_BEGIN
/// to be overridden.
@interface RACStream<__covariant ValueType> : NSObject

_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wstrict-prototypes\"") \
typedef id _Nonnull (^RACReduceBlock)();
typedef ValueType _Nonnull (^RACGenericReduceBlock)();
_Pragma("clang diagnostic pop")

/// Returns an empty stream.
+ (__kindof RACStream<ValueType> *)empty;

Expand Down Expand Up @@ -170,7 +176,7 @@ typedef RACStream * _Nullable (^RACStreamBindBlock)(ValueType _Nullable value, B
/// return value must be an object. This argument cannot be nil.
///
/// Returns a new stream of reduced tuple values.
- (__kindof RACStream *)reduceEach:(id _Nullable (^)())reduceBlock;
- (__kindof RACStream *)reduceEach:(RACReduceBlock)reduceBlock;

/// Returns a stream consisting of `value`, followed by the values in the
/// receiver.
Expand Down Expand Up @@ -221,7 +227,7 @@ typedef RACStream * _Nullable (^RACStreamBindBlock)(ValueType _Nullable value, B
///
/// Returns a new stream containing the results from each invocation of
/// `reduceBlock`.
+ (__kindof RACStream<ValueType> *)zip:(id<NSFastEnumeration>)streams reduce:(id _Nullable (^)())reduceBlock;
+ (__kindof RACStream<ValueType> *)zip:(id<NSFastEnumeration>)streams reduce:(RACGenericReduceBlock)reduceBlock;

/// Returns a stream obtained by concatenating `streams` in order.
+ (__kindof RACStream<ValueType> *)concat:(id<NSFastEnumeration>)streams;
Expand Down
4 changes: 2 additions & 2 deletions ReactiveObjC/RACStream.m
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ - (__kindof RACStream *)ignore:(id)value {
}] setNameWithFormat:@"[%@] -ignore: %@", self.name, RACDescription(value)];
}

- (__kindof RACStream *)reduceEach:(id (^)())reduceBlock {
- (__kindof RACStream *)reduceEach:(RACReduceBlock)reduceBlock {
NSCParameterAssert(reduceBlock != nil);

__weak RACStream *stream __attribute__((unused)) = self;
Expand Down Expand Up @@ -234,7 +234,7 @@ + (__kindof RACStream *)zip:(id<NSFastEnumeration>)streams {
}] setNameWithFormat:@"+zip: %@", streams];
}

+ (__kindof RACStream *)zip:(id<NSFastEnumeration>)streams reduce:(id (^)())reduceBlock {
+ (__kindof RACStream *)zip:(id<NSFastEnumeration>)streams reduce:(RACGenericReduceBlock)reduceBlock {
NSCParameterAssert(reduceBlock != nil);

RACStream *result = [self zip:streams];
Expand Down
2 changes: 1 addition & 1 deletion ReactiveObjC/extobjc/EXTScope.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
_Pragma("clang diagnostic pop")

/*** implementation details follow ***/
typedef void (^rac_cleanupBlock_t)();
typedef void (^rac_cleanupBlock_t)(void);

static inline void rac_executeCleanupBlock (__strong rac_cleanupBlock_t *block) {
(*block)();
Expand Down

1 comment on commit eeaaefa

@dengV
Copy link

@dengV dengV commented on eeaaefa Jan 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent

Please sign in to comment.