Skip to content

Commit 9d3c63a

Browse files
author
Harlan Haskins
committed
Add package decls to the test too
1 parent 5bd23c1 commit 9d3c63a

File tree

2 files changed

+25
-12
lines changed

2 files changed

+25
-12
lines changed

lib/AST/ProtocolConformance.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ bool ProtocolConformance::isRetroactive() const {
187187

188188
auto isSameRetroactiveContext =
189189
[](ModuleDecl *moduleA, ModuleDecl *moduleB) -> bool {
190-
return moduleA->isSameModuleLookingThroughOverlays(moduleB)) ||
191-
moduleA->inSamePackage(moduleB));
190+
return moduleA->isSameModuleLookingThroughOverlays(moduleB) ||
191+
moduleA->inSamePackage(moduleB);
192192
};
193193

194194
if (isSameRetroactiveContext(extensionModule, protocolModule)) {

test/Sema/extension_retroactive_conformances_package.swift

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,36 @@
66

77
//--- Library.swift
88

9-
public class LibraryClass {
10-
}
11-
12-
public protocol LibraryProtocol {
13-
}
9+
public class LibraryClass {}
10+
public protocol LibraryProtocol {}
11+
package class PackageLibraryClass {}
12+
package protocol PackageLibraryProtocol {}
1413

1514
//--- OtherLibrary.swift
1615
public class OtherLibraryClass {}
17-
public class OtherLibraryProtocol {}
16+
public protocol OtherLibraryProtocol {}
17+
package class PackageOtherLibraryClass {}
18+
package protocol PackageOtherLibraryProtocol {}
1819

1920
//--- Client.swift
2021

21-
import Library
22-
import OtherLibrary
22+
// package import Library
23+
// package import OtherLibrary
2324

24-
// These are all fine because all 3 of these libraries are in the same package.
25+
// These are all fine because all 3 of these modules are in the same package.
2526

2627
extension LibraryClass: LibraryProtocol {}
2728
extension OtherLibraryClass: LibraryProtocol {}
28-
extension LibraryClass: OtherLibraryProtocol {}
29+
extension LibraryClass: OtherLibraryProtocol {}
30+
31+
extension PackageLibraryClass: LibraryProtocol {}
32+
extension PackageOtherLibraryClass: LibraryProtocol {}
33+
extension PackageLibraryClass: OtherLibraryProtocol {}
34+
35+
extension LibraryClass: PackageLibraryProtocol {}
36+
extension OtherLibraryClass: PackageLibraryProtocol {}
37+
extension LibraryClass: PackageOtherLibraryProtocol {}
38+
39+
extension PackageLibraryClass: PackageLibraryProtocol {}
40+
extension PackageOtherLibraryClass: PackageLibraryProtocol {}
41+
extension PackageLibraryClass: PackageOtherLibraryProtocol {}

0 commit comments

Comments
 (0)