SIL: Don't descend into nominal types' parents to determine linkage.

A type in an extension doesn't inherit linkage from its parent. In particular, if an extension adds a nested type to an imported class, we don't want that nested type to have unique linkage. Fixes rdar://problem/19792174.

Swift SVN r25191
This commit is contained in:
Joe Groff
2015-02-11 20:16:45 +00:00
parent 4501aac830
commit 8c9f7a664d
2 changed files with 11 additions and 0 deletions

View File

@@ -100,6 +100,9 @@ FormalLinkage swift::getTypeLinkage(CanType type) {
// For any nominal type reference, look at the type declaration.
if (auto nominal = type->getAnyNominal()) {
result ^= getDeclLinkage(nominal);
// The generic parameters or parent of the nominal type don't affect the
// declaration's linkage. We can stop.
return true;
// For polymorphic function types, look at the generic parameters.
// FIXME: findIf should do this, once polymorphic function types can be