diff options
-rw-r--r-- | lib/Rewrite/RewriteObjC.cpp | 6 | ||||
-rw-r--r-- | test/Rewriter/property-dot-syntax.mm | 18 |
2 files changed, 24 insertions, 0 deletions
diff --git a/lib/Rewrite/RewriteObjC.cpp b/lib/Rewrite/RewriteObjC.cpp index 8532bc7f13..4c929a246b 100644 --- a/lib/Rewrite/RewriteObjC.cpp +++ b/lib/Rewrite/RewriteObjC.cpp @@ -5479,6 +5479,12 @@ Stmt *RewriteObjC::RewriteFunctionBodyOrGlobalInitializer(Stmt *S) { // ^(NSURL *errorURL, NSError *error) { return (BOOL)1; }; SourceRange SrcRange = BinOp->getSourceRange(); Stmt *newStmt = RewriteFunctionBodyOrGlobalInitializer(BinOp->getRHS()); + // Need to rewrite the ivar access expression if need be. + if (isa<ObjCIvarRefExpr>(newStmt)) { + bool replaced = false; + newStmt = RewriteObjCNestedIvarRefExpr(newStmt, replaced); + } + DisableReplaceStmt = false; // // Unlike the main iterator, we explicily avoid changing 'BinOp'. If diff --git a/test/Rewriter/property-dot-syntax.mm b/test/Rewriter/property-dot-syntax.mm index 965d1e7c6f..846bd824b5 100644 --- a/test/Rewriter/property-dot-syntax.mm +++ b/test/Rewriter/property-dot-syntax.mm @@ -26,3 +26,21 @@ void *sel_registerName(const char *); } @end +//rdar: // 8541517 +@interface A { } +@property (retain) NSString *scheme; +@end + +@interface B : A { + NSString* _schemeName; +} +@end + + +@implementation B +-(void) test { + B *b; + b.scheme = _schemeName; // error because of this line +} +@end + |