mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Ensure that we use the correct python to run the python based tools. This also allows these tools to run on Windows which will not necessarily associate the python script with an interpreter (python).
20 lines
524 B
Swift
20 lines
524 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %{python} %utils/split_file.py -o %t %s
|
|
// RUN: %target-swift-frontend -typecheck %t/file1.swift -primary-file %t/file2.swift -verify
|
|
|
|
// BEGIN file1.swift
|
|
private protocol P {
|
|
func privMethod()
|
|
}
|
|
public class C : P {
|
|
public init() {}
|
|
fileprivate func privMethod() {} // expected-note {{declared here}}
|
|
}
|
|
|
|
// BEGIN file2.swift
|
|
extension C {
|
|
public func someFunc() {
|
|
privMethod() // expected-error {{'privMethod' is inaccessible due to 'fileprivate' protection level}}
|
|
}
|
|
}
|