mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
19 lines
402 B
Swift
19 lines
402 B
Swift
// RUN: %target-swift-frontend -O -emit-sil %s | %FileCheck %s
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
import Foundation
|
|
|
|
protocol FooProtocol : class {
|
|
}
|
|
|
|
class FooProtocolImplementation : NSObject, FooProtocol {
|
|
}
|
|
|
|
// CHECK-LABEL: sil @{{.*}}testit
|
|
// CHECK: checked_cast_addr_br {{.*}} AnyHashable {{.*}} to any FooProtocol
|
|
public func testit(_ x: AnyHashable) -> Bool {
|
|
return (x as? FooProtocol) != nil
|
|
}
|
|
|