Skip to content
Snippets Groups Projects
Commit 506e717e authored by Steve Naroff's avatar Steve Naroff
Browse files

Fix <rdar://problem/6247781> Parser rejecting properly mismatched properties.

llvm-svn: 56821
parent 7273d01d
No related branches found
No related tags found
No related merge requests found
...@@ -1254,14 +1254,14 @@ Sema::DeclTy *Sema::ActOnPropertyImplDecl(SourceLocation AtLoc, ...@@ -1254,14 +1254,14 @@ Sema::DeclTy *Sema::ActOnPropertyImplDecl(SourceLocation AtLoc,
PropertyId->getName()); PropertyId->getName());
return 0; return 0;
} }
// Check that type of property and its ivar match. // Check that type of property and its ivar are type compatible.
if (Context.getCanonicalType(Ivar->getType()) != // A property is allowed to be a sub-class of the instance variable type.
Context.getCanonicalType(property->getType())) { if (CheckAssignmentConstraints(property->getType(),
Ivar->getType()) != Compatible) {
Diag(PropertyLoc, diag::error_property_ivar_type, property->getName(), Diag(PropertyLoc, diag::error_property_ivar_type, property->getName(),
Ivar->getName()); Ivar->getName());
return 0; return 0;
} }
} else if (PropertyIvar) { } else if (PropertyIvar) {
// @dynamic // @dynamic
Diag(PropertyLoc, diag::error_dynamic_property_ivar_decl); Diag(PropertyLoc, diag::error_dynamic_property_ivar_decl);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment