mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
48 lines
993 B
Swift
48 lines
993 B
Swift
// RUN: %target-swift-frontend -O -emit-ir %s
|
|
|
|
// https://github.com/apple/swift/issues/53420
|
|
|
|
public class Coordinator: ConcreteCoordinator {
|
|
public func coordinate() {
|
|
|
|
}
|
|
}
|
|
|
|
public typealias ConcreteCoordinator = InternalBaseCoordinator & CoordinatorProtocol
|
|
|
|
public protocol CoordinatorProtocol {
|
|
func coordinate()
|
|
}
|
|
|
|
public protocol ViewBridgeProtocol {
|
|
func createCoordinator() -> ConcreteCoordinator
|
|
}
|
|
|
|
public class InternalBaseViewBridge {
|
|
|
|
public func startCoordinator() {
|
|
abstract().createCoordinator()
|
|
.with(success: nil)
|
|
.coordinate()
|
|
}
|
|
|
|
private func abstract() -> ViewBridgeProtocol {
|
|
return self as! ViewBridgeProtocol
|
|
}
|
|
|
|
}
|
|
|
|
public class InternalBaseCoordinator: InternalCoordinatorProtocol {
|
|
|
|
}
|
|
|
|
public protocol InternalCoordinatorProtocol: AnyObject {
|
|
|
|
}
|
|
|
|
extension InternalCoordinatorProtocol {
|
|
public func with(success: ((ConcreteCoordinator) -> Void)?) -> Self {
|
|
return self
|
|
}
|
|
}
|