Skip to content

Commit 2af24b2

Browse files
committed
Tests: Verify ExtensionImportVisibility works for @_exported imports.
1 parent 77c0aae commit 2af24b2

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

test/NameLookup/Inputs/extensions_A.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,11 @@ public struct Y<T> { }
77
extension Y: P where T: P { }
88

99
public struct Z: P { }
10+
11+
extension X {
12+
public func XinA() { }
13+
}
14+
15+
extension Y {
16+
public func YinA() { }
17+
}

test/NameLookup/Inputs/extensions_C.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import extensions_A
1+
@_exported import extensions_A
22
import extensions_B
33

44
extension X {

test/NameLookup/extensions_transitive.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
// RUN: %target-swift-frontend -emit-module -I %t -o %t %S/Inputs/extensions_C.swift
55
// RUN: %target-swift-frontend -typecheck %s -I %t -verify -enable-experimental-feature ExtensionImportVisibility
66

7-
import extensions_A
87
import extensions_C
98
// expected-note 2{{add import of module 'extensions_B'}}{{1-1=import extensions_B\n}}
109
func test(x: X, y: Y<Z>) {
10+
x.XinA()
11+
y.YinA()
12+
1113
x.XinB() // expected-error{{instance method 'XinB()' is not available due to missing import of defining module 'extensions_B'}}
1214
y.YinB() // expected-error{{instance method 'YinB()' is not available due to missing import of defining module 'extensions_B'}}
1315

0 commit comments

Comments
 (0)