Skip to content
This repository was archived by the owner on Dec 5, 2019. It is now read-only.

Commit 3acbd6a

Browse files
authored
Merge pull request #135 from ole/keypath-reverse-condition
Make @keypath macro more resilient when combined with other expressions
2 parents 6c5b3c0 + 8d3d597 commit 3acbd6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

extobjc/EXTKeyPathCoding.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ NSString *lowercaseStringPath = @keypath(NSString.new, lowercaseString);
3838
#define keypath(...) \
3939
_Pragma("clang diagnostic push") \
4040
_Pragma("clang diagnostic ignored \"-Warc-repeated-use-of-weak\"") \
41-
(YES).boolValue ? (NSString * _Nonnull)@(cStringKeypath(__VA_ARGS__)) : (NSString * _Nonnull)nil \
41+
(NO).boolValue ? ((NSString * _Nonnull)nil) : ((NSString * _Nonnull)@(cStringKeypath(__VA_ARGS__))) \
4242
_Pragma("clang diagnostic pop") \
4343

4444
#define cStringKeypath(...) \

0 commit comments

Comments
 (0)