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


  /// Get a pointer to a `DeferredTask` that will resolve this `Deferred`

  private func deferredTask(from state: Int) -> UnsafeMutablePointer<DeferredTask>?
  {
    guard state.tag == .waiting else { return nil }
    return state.ptr?.assumingMemoryBound(to: DeferredTask.self)

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