 
 public class Deferred<T>
 {
-  private var r: Result<T>! = nil
+  private var r: Result<T>
   private let group = dispatch_group_create()
 
   // Swift does not have a facility to read and write enum values atomically.

  private init()
  {
    dispatch_group_enter(group)
  }

  deinit
  {
    if r == nil
    {
      dispatch_group_leave(group)
    }


    currentState = DeferredState.Executing.rawValue
    dispatch_async(queue) {
      let result = Result<T> { try task() }
      do {  try self.setResult(result) }
      catch { /* an error here means this `Deferred` was canceled before `task()` was complete. */ }
    }
