Files
swift-mirror/test/SILGen/generic_objc_block_bridge.swift
Slava Pestov af11149550 SIL: Implement the [serialized] vs [serializable] distinction
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)
2017-03-29 20:09:35 -07:00

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 {