   ([p] (deliver p nil))
   ([p v]
    {:pre [(promise? p)]}
-   (let [f (future p)]
+   (let [f (promise->future p)]
      (if (instance? Throwable v)
        (.completeExceptionally f v)
        (.complete f v)))))

  array are resolved."
  [promises]
  (let [promises (map promise promises)
        futures (map future promises)
        promise' (->> (into-array CompletableFuture futures)
                      (CompletableFuture/allOf)
                      (Promise.))]

  [p]
  (pending* p))

(defn promise->future
  "Converts a promise in a CompletableFuture instance."
  [^Promise p]
  (.-cf p))
