Skip to content

Commit 2662781

Browse files
committed
[Sema] Add test case for protcol requirement accessibility across files
1 parent 87ee594 commit 2662781

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// RUN: rm -rf %t && mkdir -p %t
2+
// RUN: %utils/split_file.py -o %t %s
3+
// RUN: %target-swift-frontend -parse %t/file1.swift -primary-file %t/file2.swift -verify
4+
5+
// BEGIN file1.swift
6+
private protocol P {
7+
func privMethod()
8+
}
9+
public class C : P {
10+
public init() {}
11+
fileprivate func privMethod() {}
12+
}
13+
14+
// BEGIN file2.swift
15+
extension C {
16+
public func someFunc() {
17+
privMethod() // expected-error {{use of unresolved identifier 'privMethod'}}
18+
}
19+
}

0 commit comments

Comments
 (0)