     public typealias NextType = Promise
     public typealias ValueType = V
     public typealias ReasonType = NSError
-    public typealias ReturnType = Promise
+    public typealias ReturnType = Void
 
     public typealias FulfillClosure = (value: V) -> Any?
     public typealias RejectClosure = (reason: NSError?) -> Any?

            }
        )
    }
    
    // MARK: - Private APIs
    
    func onFulfilled(value: V) -> Void
    {
        if self.state != .Pending {
            return
        }
        
        self.value = value
        self.state = .Fulfilled
        
        /*
        for then in self.thens
        {
            let subPromise = then.subPromise
            if let resolution = then.resolution?
            {
                let output = resolution(value: value)
                subPromise.resolve(output)
            }
            else
            {
                subPromise.onFulfilled(value)
            }
        }
*/
    }
    
    func onRejected(reason: NSError) -> Void
    {
        if self.state != .Pending {
            return
        }
        
        self.reason = reason
        self.state = .Rejected
        /*
        for then in self.thens
        {
            let subPromise = then.subPromise
            if let rejection = then.rejection?
            {
                let value = rejection(reason: reason)
                subPromise.resolve(value)
            }
            else
            {
                subPromise.onRejected(value)
            }
        }
*/
    }
    
    func resolve(value: V)
    {
        if self.state != .Pending {
            return
        }
        
        switch value {
        case let promise as APlusPromise:
            if promise === self {
                self.onRejected(NSError.aPlusPromiseTypeError())
            }
            else {
                promise.then(
                    onFulfilled: { (value) -> Any? in
                        self.onFulfilled(value)
                        return nil
                    },
                    onRejected: { (reason) -> Any? in
                        self.onRejected(reason)
                        return nil
                    }
                )
            }
        default:
            self.onFulfilled(value)
        }
    }

    
    
    // MARK: - Thenable

    public func then<N>(

        )
    }

    convenience
    public init<T: Thenable where T.ValueType == V, T.ReasonType == NSError, T.ReturnType == Void>(voidThenable: T)
    {
        self.init()
        self.resolve(voidThenable: voidThenable)
    }
    
    convenience
    public init<T: Thenable where T.ValueType == V, T.ReasonType == NSError, T.ReturnType == Optional<Any>>(thenable: T)
    {
        self.init()
        self.resolve(thenable: thenable)
    }

    
    // MARK: - Private APIs
    
    func onFulfilled(value: V) -> Void
    {
        if self.state != .Pending {
            return
        }
        
        self.value = value
        self.state = .Fulfilled
        
        /*
        for then in self.thens
        {
            let subPromise = then.subPromise
            if let resolution = then.resolution?
            {
                let output = resolution(value: value)
                subPromise.resolve(output)
            }
            else
            {
                subPromise.onFulfilled(value)
            }
        }
*/
    }
    
    func onRejected(reason: NSError) -> Void
    {
        if self.state != .Pending {
            return
        }
        
        self.reason = reason
        self.state = .Rejected
        /*
        for then in self.thens
        {
            let subPromise = then.subPromise
            if let rejection = then.rejection?
            {
                let value = rejection(reason: reason)
                subPromise.resolve(value)
            }
            else
            {
                subPromise.onRejected(value)
            }
        }
*/
    }
    
    // TODO: Think if remove this
    func resolve(#some: Any?)
    {
        if self.state != .Pending {
            return
        }

        switch some {
        case let promise as Promise<V>:
            self.resolve(voidThenable: promise)
        case let value as V:
            self.resolve(value: value)
        default:
            self.onFulfilled(some! as V)
        }
    }
    
    func resolve(#value: V)
    {
        if self.state != .Pending {
            return
        }
        
        self.onFulfilled(value)
    }
/*
    func resolve(#promise: Promise)
    {
        if self.state != .Pending {
            return
        }

        if promise === self {
            self.onRejected(NSError.aPlusPromiseTypeError())    // TODO: Replace aPlusPromiseTypeError
        }
        else {
            promise.then(
                onFulfilled: { (value) -> Void in
                    self.onFulfilled(value)
                },
                onRejected: { (reason) -> Void in
                    self.onRejected(reason)
                }
            )
        }
    }
    */
    func resolve<T: Thenable where T.ValueType == V, T.ReasonType == NSError, T.ReturnType == Void>(#voidThenable: T)
    {
        if self.state != .Pending {
            return
        }

        if (voidThenable as? Promise<V> === self) {
            self.onRejected(NSError.aPlusPromiseTypeError())    // TODO: Replace aPlusPromiseTypeError
        }
        else {
            voidThenable.then(
                onFulfilled: { (value: V) -> Void in
                    self.onFulfilled(value)
                },
                onRejected: { (reason: NSError) -> Void in
                    self.onRejected(reason)
                }
            )
        }
    }
    
    func resolve<T: Thenable where T.ValueType == V, T.ReasonType == NSError, T.ReturnType == Optional<Any>>(#thenable: T)
    {
        if self.state != .Pending {
            return
        }
        
        thenable.then(
            onFulfilled: { (value: V) -> Any? in
