   var ptr: UnsafeMutableRawPointer? { return UnsafeMutableRawPointer(bitPattern: self & ~.stateMask) }
 }
 
-private struct DeferredTask
-{
-  let task: () -> Void
+private struct DeferredTask<Success, Failure: Error>
+{
+  let task: (Resolver<Success, Failure>) -> Void
 }
 
 /// An asynchronous computation.

    if let taskp = deferredTask(from: current)
    { // we need to execute the task
      self.queue.async {
        taskp.pointee.task()
        taskp.deinitialize(count: 1)
        taskp.deallocate()
      }

  public init(queue: DispatchQueue, resolve: @escaping (Resolver<Success, Failure>) -> Void)
  {
    self.queue = queue
    let taskp = UnsafeMutablePointer<DeferredTask<Success, Failure>>.allocate(capacity: 1)
    taskp.initialize(to: DeferredTask(task: resolve))
    CAtomicsInitialize(deferredState, Int(taskp, tag: .waiting))
  }

