Don't synthesize materializeForSet for members of protocol extensions.

They aren't dynamically dispatched contexts.

Swift SVN r27067
This commit is contained in:
Doug Gregor
2015-04-07 06:01:17 +00:00
parent 441fb9856c
commit 5406878a7f

View File

@@ -1799,9 +1799,10 @@ void swift::maybeAddMaterializeForSet(AbstractStorageDecl *storage,
NominalTypeDecl *container = containerTy->getAnyNominal();
assert(container && "extension of non-nominal type?");
// - in non-ObjC protocols
// - in non-ObjC protocols, but not protocol extensions.
if (auto protocol = dyn_cast<ProtocolDecl>(container)) {
if (protocol->isObjC()) return;
if (storage->getDeclContext()->isProtocolExtensionContext()) return;
// - in classes when the storage decl is not final and does
// not override a decl that requires a materializeForSet