]> granicus.if.org Git - clang/commitdiff
Fixes a bug in my last patch. Order of types reversed.
authorFariborz Jahanian <fjahanian@apple.com>
Fri, 8 May 2009 21:10:00 +0000 (21:10 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Fri, 8 May 2009 21:10:00 +0000 (21:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71267 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclObjC.cpp
test/SemaObjC/property-typecheck-1.m

index 981d13c15e4de48fdff6f5bfa3f312564784aaea..76e73fc650cb2e5210015b6d3287771ec645e0c1 100644 (file)
@@ -26,8 +26,7 @@ bool Sema::DiagnosePropertyAccessorMismatch(ObjCPropertyDecl *property,
       GetterMethod->getResultType() != property->getType()) {
     AssignConvertType result = Incompatible;
     if (Context.isObjCObjectPointerType(property->getType()))
-      result = CheckAssignmentConstraints(property->getType(), 
-                                          GetterMethod->getResultType());
+      result = CheckAssignmentConstraints(GetterMethod->getResultType(), property->getType());
     if (result != Compatible) {
       Diag(Loc, diag::warn_accessor_property_type_mismatch) 
         << property->getDeclName()
index c4d7cd2448d5e1b4963b9971a1ee605ba0d72555..ca8a1393b01bc841b021a094185e52d9760a531e 100644 (file)
@@ -73,11 +73,11 @@ typedef void (F)(void);
  NSArray* first;
 }
 
-@property (readonly) NSArray* pieces;
-@property (readonly) NSMutableArray* first; // expected-warning {{type of property 'first' does not match type of accessor 'first'}}
+@property (readonly) NSArray* pieces;  // expected-warning {{type of property 'pieces' does not match type of accessor 'pieces'}}
+@property (readonly) NSMutableArray* first; 
 
-- (NSMutableArray*) pieces;
-- (NSArray*) first;    // expected-note {{declared at}}  // expected-note {{declared at}}
+- (NSMutableArray*) pieces; // expected-note {{declared at}} // expected-note {{declared at}}
+- (NSArray*) first;
 @end
 
 @interface Class2  {
@@ -90,12 +90,12 @@ typedef void (F)(void);
 
 - (id) lastPiece
 {
- return container.pieces;
+ return container.pieces; // expected-warning {{type of property 'pieces' does not match type of accessor 'pieces'}}
 }
 
 - (id)firstPeice
 {
-  return container.first; // expected-warning {{type of property 'first' does not match type of accessor 'first'}}
+  return container.first; 
 }
 @end