Skip to content

Commit a56cd12

Browse files
authored
Merge pull request #29554 from CodaFi/module-scope-context-is-king
2 parents a34b044 + 3375b36 commit a56cd12

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/Serialization/Deserialization.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1468,6 +1468,10 @@ ModuleFile::resolveCrossReference(ModuleID MID, uint32_t pathLen) {
14681468
if (auto overlayModule = LF->getOverlayModule()) {
14691469
nestedType = findNestedTypeDeclInModule(getFile(), overlayModule,
14701470
memberName, baseType);
1471+
} else if (LF->getParentModule() != extensionModule) {
1472+
nestedType = findNestedTypeDeclInModule(getFile(),
1473+
LF->getParentModule(),
1474+
memberName, baseType);
14711475
}
14721476
}
14731477
}

test/Serialization/multi-file-nested-type-extension.swift

+7-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// REQUIRES: asserts
1111

1212
// CHECK: Statistics
13-
// CHECK: 1 Serialization - # of nested types resolved without full lookup
13+
// CHECK: 2 Serialization - # of nested types resolved without full lookup
1414

1515
// Note the Optional here and below; this was once necessary to produce a crash.
1616
// Without it, the type of the parameter is initialized "early" enough to not
@@ -21,3 +21,9 @@ extension Outer {
2121

2222
public func useTypes(_: Outer.Callback?) {}
2323
}
24+
25+
extension OuterClass.Inner {
26+
public static var instance: OuterClass.Inner {
27+
return OuterClass.Inner()
28+
}
29+
}

0 commit comments

Comments
 (0)