mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This generalizes a hack where re-abstraction thunks become fragile on contact with fragile functions. The old policy was: - [fragile] functions always serialized - [reabstraction_thunk] transitively referenced from fragile always serialized The new policy is: - [serialized] functions always serialized - [serializable] functions transitively referenced from serialized functions are always serialized - Most kinds of thunks can now be [serializable], allowing them to be shared between serialized and non-serialized code without any issues, as long as the body of the thunk is sufficiently "simple" (doesn't reference private symbols or performs direct access to resilient types)
18 lines
510 B
Swift
18 lines
510 B
Swift
// RUN: %target-swift-frontend -emit-silgen -sdk %S/Inputs -I %S/Inputs -enable-source-import %s | %FileCheck %s
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
import Foundation
|
|
|
|
class Butt: NSObject {
|
|
dynamic func butt(_ b: (Int) -> Int) {}
|
|
}
|
|
|
|
class Tubb<GenericParamName>: Butt {
|
|
override func butt(_ b: (Int) -> Int) {
|
|
super.butt(b)
|
|
}
|
|
}
|
|
|
|
// CHECK-LABEL: sil shared [transparent] [serializable] [reabstraction_thunk] @_T0S2iIyByd_S2iIxyd_TR : $@convention(thin) (Int, @owned @convention(block) (Int) -> Int) -> Int {
|