mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
14 lines
396 B
Swift
14 lines
396 B
Swift
// RUN: %target-typecheck-verify-swift -enable-objc-interop -swift-version 4
|
|
|
|
@objc protocol Opt {
|
|
@objc optional func f(callback: @escaping () -> ())
|
|
}
|
|
|
|
class Conforms : Opt {
|
|
private func f(callback: () -> ()) {} // expected-note {{'f(callback:)' declared here}}
|
|
}
|
|
|
|
func g(x: Conforms) {
|
|
_ = x.f(callback: {}) // expected-error {{'f' is inaccessible due to 'private' protection level}}
|
|
}
|