mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
19 lines
356 B
Swift
19 lines
356 B
Swift
// RUN: %target-swift-frontend -emit-ir %s -disable-objc-attr-requires-foundation-module
|
|
// REQUIRES: objc_interop
|
|
|
|
// https://github.com/apple/swift/issues/43937
|
|
|
|
@objc protocol TestProtocol {
|
|
func foo(i: Int)
|
|
}
|
|
|
|
class Test : TestProtocol {
|
|
@objc func foo(i: Int) {
|
|
}
|
|
}
|
|
|
|
func bar(t: TestProtocol?) {
|
|
let foofunc = t?.foo
|
|
foofunc?(5)
|
|
}
|