mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
19 lines
495 B
Swift
19 lines
495 B
Swift
// RUN: %target-swift-frontend -emit-sil -O %s | %FileCheck %s
|
|
|
|
protocol P { func p() -> Any.Type }
|
|
protocol Q: P { }
|
|
|
|
@inline(never) func sink<T>(_ x: T) {}
|
|
|
|
func p<T: Q>(_ x: T) { sink(x.p()) }
|
|
|
|
class Foo<T>: Q { func p() -> Any.Type { return T.self } }
|
|
class Bar<T>: Foo<T> {}
|
|
|
|
// CHECK-LABEL: sil @_T0031specialize_class_inherits_base_C9_protocol3fooyyF
|
|
public func foo() {
|
|
// CHECK: function_ref @_T0031specialize_class_inherits_base_C9_protocol4sinkyxlFypXp_Tg5Tf4d_n
|
|
p(Bar<Int>())
|
|
}
|
|
|