         
         return subPromise
     }
-
+    /*
     public func then<N>(
         #onFulfilled: (value: V) -> Promise<N>,
         onRejected: (reason: NSError) -> Promise<N>

        
        return subPromise
    }

    public func catch(
        onRejected: (reason: NSError) -> Void
        ) -> Self
    {
        return self.then(onFulfilled: nil, onRejected: onRejected)
    }


    public func then<N, T: Thenable where T.ValueType == N, T.ReasonType == NSError>(
        onFulfilled: (value: V) -> T,
        onRejected: (reason: NSError) -> T
        ) -> Promise<N>
    {
        let subPromise = Promise<N>()
        
        
        return subPromise
    }
}
        
        self.onFulfilled(value)
    }

    func resolve<T: Thenable where T.ValueType == V, T.ReasonType == NSError>(#thenable: T)
    {
        if self.state != .Pending {
            return
        }
        
        if let promise = thenable as? Promise<V> {
            if promise === self {
                self.onRejected(NSError.aPlusPromiseTypeError())    // TODO: Replace aPlusPromiseTypeError
            }
        }
        
        thenable.then(
