Sema: Don't synth "materializeForSet" for @objc protocol requirements.

Another fix for rdar://problem/18706056. This should make @NSManaged properties work fine with @objc protocols, but I expect us to still be broken with native protocols.

Swift SVN r24862
This commit is contained in:
Joe Groff
2015-01-30 23:41:10 +00:00
parent 2dc65341f2
commit 0225fa568a
2 changed files with 10 additions and 2 deletions

View File

@@ -953,7 +953,11 @@ void TypeChecker::synthesizeWitnessAccessorsForStorage(
// Otherwise, if the requirement is settable, ensure that there's a
// materializeForSet function.
if (requirement->getSetter() && !storage->getMaterializeForSetFunc()) {
//
// @objc protocols don't need a materializeForSet since ObjC doesn't have
// that concept.
if (!requirement->isObjC() &&
requirement->getSetter() && !storage->getMaterializeForSetFunc()) {
FuncDecl *materializeForSet = addMaterializeForSet(storage, *this);
synthesizeMaterializeForSet(materializeForSet, storage, *this);
typeCheckDecl(materializeForSet, true);