     
     public static func preResolved(value: T) -> Future<T> {
         let future = Future<T>()
-        future.value = value
+        future.result = .success(value)
         return future
     }
     
     public static func preRejected(error: Error) -> Future<T> {
         let future = Future<T>()
-        future.error = error
+        future.result = .error(error)
         return future
     }
     

    private var errorBlock: ErrorBlock?
    private var finallyBlock: (()->())?
    private var childFuture: Future?

    let lockQueue = DispatchQueue(label: "com.concurrency.future.\(NSUUID().uuidString)")

    //MARK: - PUBLIC -
    
    fileprivate(set) var value: T?
    fileprivate(set) var error: Error?
    
    public var succeeded: Bool {
        return value != nil

    public var isComplete: Bool {
        return succeeded || failed
    }
    
    //MARK: - Public methods

    @discardableResult public func then(_ callback: @escaping ThenBlock) -> Future<T> {
        if let value = self.value { //If the future has already been resolved with a value. Call the block immediately.
