From 42146e4750b603dd51366553320d73e82ab65377 Mon Sep 17 00:00:00 2001 From: Ricky Tan Date: Tue, 18 Sep 2018 20:50:08 +0800 Subject: [PATCH] Update EXTKeyPathCoding.h To support the following format: (`str` is a instance of `NSString *`) * @keypath(str, lowercaseString.UTF8String) * @keypath(NSString *, lowercaseString.UTF8String) * @keypath(NSString.new, lowercaseString.UTF8String); --- extobjc/EXTKeyPathCoding.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extobjc/EXTKeyPathCoding.h b/extobjc/EXTKeyPathCoding.h index 3c379655..434ddd0d 100644 --- a/extobjc/EXTKeyPathCoding.h +++ b/extobjc/EXTKeyPathCoding.h @@ -49,7 +49,7 @@ NSString *lowercaseStringPath = @keypath(NSString.new, lowercaseString); ({ char *__extobjckeypath__ = strchr(# PATH, '.'); NSCAssert(__extobjckeypath__, @"Provided key path is invalid."); __extobjckeypath__ + 1; }))) #define keypath2(OBJ, PATH) \ - (((void)(NO && ((void)OBJ.PATH, NO)), # PATH)) + (((void)(NO && ((void)(((typeof(OBJ))nil).PATH), NO)), # PATH)) /** * \@collectionKeypath allows compile-time verification of key paths across collections NSArray/NSSet etc. Given a real object