Skip to content

Commit b4940dd

Browse files
committed
Merge remote-tracking branch 'origin/master' into master-next
2 parents 6bb6e32 + 2da742e commit b4940dd

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

lib/Serialization/Deserialization.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,11 +1146,14 @@ static void filterValues(Type expectedTy, ModuleDecl *expectedModule,
11461146

11471147
if (isType != isa<TypeDecl>(value))
11481148
return true;
1149-
auto ifaceTy = value->getInterfaceType();
1150-
if (!ifaceTy)
1151-
return true;
1152-
if (canTy && ifaceTy->getCanonicalType() != canTy)
1153-
return true;
1149+
1150+
// If we're expecting a type, make sure this decl has the expected type.
1151+
if (canTy) {
1152+
auto ifaceTy = value->getInterfaceType();
1153+
if (!ifaceTy || !ifaceTy->isEqual(canTy))
1154+
return true;
1155+
}
1156+
11541157
if (value->isStatic() != isStatic)
11551158
return true;
11561159
if (value->hasClangNode() != importedFromClang)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
extension Subclass {
2+
struct MemberTypeFromOtherFile {}
3+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// RUN: %empty-directory(%t)
2+
3+
// RUN: %target-build-swift -emit-module -o %t/Module.swiftmodule %s %S/Inputs/multi-file-subclass-generic-instantiation-extension.swift
4+
5+
// https://bugs.swift.org/browse/SR-11495
6+
7+
class Superclass<T> {}
8+
class Subclass: Superclass<Subclass.MemberTypeFromOtherFile> {}

0 commit comments

Comments
 (0)