mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Back in https://github.com/apple/swift/pull/24959, marking a decl both dynamic and @nonobjc was allowed. So implicitly mark decls that are @nonobjc dynamic when -enable-implicit-dynamic is specified. rdar://112152116
27 lines
433 B
Swift
27 lines
433 B
Swift
// RUN: %target-run-simple-swift(-Xfrontend -enable-implicit-dynamic) | %FileCheck %s
|
|
|
|
// REQUIRES: executable_test
|
|
// REQUIRES: objc_interop
|
|
|
|
import Foundation
|
|
|
|
class C : NSObject {
|
|
@nonobjc func foo() {
|
|
print("original")
|
|
}
|
|
}
|
|
|
|
extension C {
|
|
@_dynamicReplacement(for: foo()) @nonobjc private func replacement_for_foo() {
|
|
print("replacement")
|
|
}
|
|
}
|
|
|
|
func doit() {
|
|
let c = C()
|
|
c.foo()
|
|
}
|
|
|
|
// CHECK: replacement
|
|
doit()
|