aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/SemaDeclObjC.cpp3
-rw-r--r--test/SemaObjC/property-typecheck-1.m12
2 files changed, 7 insertions, 8 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 981d13c15e..76e73fc650 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -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()
diff --git a/test/SemaObjC/property-typecheck-1.m b/test/SemaObjC/property-typecheck-1.m
index c4d7cd2448..ca8a1393b0 100644
--- a/test/SemaObjC/property-typecheck-1.m
+++ b/test/SemaObjC/property-typecheck-1.m
@@ -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