 
 import UIKit
 
+private protocol _ChildComponent {}
+
 private protocol _AnyComponentBox {
-    var children: [ChildComponent] { get }
+    var children: [_ChildComponent] { get }
     var isEmpty: Bool { get }
     
     func configure(item: Any)

    }
}

public struct ChildComponent: ComponentType {
    private let box: _AnyComponentBox
    let access: (Any) -> Any
    
    public init<V: ComponentType, T>(component: V, _ access: @escaping (T) -> V.View) {
        self.init(_ConcreteComponentBox(base: component), { view in access(view as! T) })
    }
    
    private init(_ box: _AnyComponentBox, _ access: @escaping (Any) -> Any) {
        self.box = box
        self.access = access
    }

        return lhs.box.isEqual(to: rhs.box)
    }
    
    public func diffChanges(from other: ChildComponent<View>) -> ChildComponent<View> {
        return ChildComponent(box.diffChanges(from: other.box), other.access)
    }
}
