Files
swift-mirror/validation-test/Runtime/rdar64672291.swift
2021-04-13 15:42:33 -07:00

28 lines
521 B
Swift

// RUN: %target-run-simple-swift
// REQUIRES: objc_interop
// REQUIRES: executable_test
// UNSUPPORTED: use_os_stdlib
// UNSUPPORTED: back_deployment_runtime
import Foundation
final class Storage<T: NSObject> {
weak var object: T?
init(object: T) {
self.object = object
}
}
@objc protocol MyProtocol {}
typealias MyStorage = Storage<NSObject & MyProtocol>
class Gadget: NSObject, MyProtocol {
func testit() {
_ = MyStorage(object: self)
}
}
let gadget = Gadget()
gadget.testit()