mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user