Skip to content

Commit 3694615

Browse files
committed
Reproducer for rdar://143582881.
1 parent 464d9d3 commit 3694615

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %empty-directory(%t/src)
3+
// RUN: split-file %s %t/src
4+
5+
/// Build the library A
6+
// RUN: %target-swift-frontend -emit-module %t/src/A.swift \
7+
// RUN: -module-name A \
8+
// RUN: -emit-module-path %t/A.swiftmodule
9+
10+
/// Build the library B
11+
// RUN: %target-swift-frontend -I %t -emit-module %t/src/B.swift \
12+
// RUN: -module-name B \
13+
// RUN: -emit-module-path %t/B.swiftmodule
14+
15+
// RUN: %target-swift-frontend -typecheck -I %t %t/src/Main.swift %t/src/Other.swift -enable-upcoming-feature MemberImportVisibility
16+
17+
// REQUIRES: swift_feature_MemberImportVisibility
18+
19+
//--- A.swift
20+
public struct Test {
21+
public init(a: Double) { }
22+
}
23+
24+
//--- B.swift
25+
import A
26+
27+
extension Test {
28+
public init(a: Int) { fatalError() }
29+
}
30+
31+
//--- Main.swift
32+
import A
33+
34+
func test() {
35+
_ = Test(a: 0) // Ok, selects the overload that takes Double.
36+
}
37+
38+
//--- Other.swift
39+
import B
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: split-file %s %t
3+
4+
// RUN: %target-swift-frontend -typecheck %t/Main.swift %t/Other.swift -enable-upcoming-feature MemberImportVisibility
5+
6+
//--- Main.swift
7+
8+
import Foundation
9+
10+
func test() -> CGSize {
11+
return CGSize(width: 60, height: 45)
12+
}
13+
14+
//--- Other.swift
15+
16+
import CoreGraphics

0 commit comments

Comments
 (0)