blob: 900d02c57c0c9b68683e17fe38b597c0c0264628 [file] [log] [blame]
// RUN: %target-swift-frontend -emit-sil -O %s | FileCheck %s
class S<T> {
func f<U>(_ x: T, _ y: U) -> T { return x }
}
// Check that invocation of a method that has its own
// generic parameter can be devirtualized correctly.
// The body of the method f should be inlined.
// No remaining class_method or apply instructions
// should be present after optimizations are applied.
// CHECK-LABEL: sil @_TF33devirt_method_with_generic_params38testDevirtMethodWithItsOwnGenericParamFT_Si
// CHECK-NOT: class_method
// CHECK-NOT: apply
// CHECK: return
public func testDevirtMethodWithItsOwnGenericParam() -> Int {
let s: S<Int> = S<Int>()
return s.f(0, 0.0)
}