 // UNSUPPORTED: back_deployment_runtime
 
 import _Distributed
+
+enum MyError: Error {
+  case test
+}
 
 @available(SwiftStdlib 5.5, *)
 distributed actor PickATransport1 {

  // CHECK: ready actor:main.PickATransport1, id:AnyActorIdentity(ActorAddress(address: "[[ID]]"))
  // CHECK: resign id:AnyActorIdentity(ActorAddress(address: "[[ID]]"))

  _ = await PickATransport2(other: 1, theTransport: transport)
  // CHECK: assign type:PickATransport2, id:ActorAddress(address: "[[ID:.*]]")
  // CHECK: ready actor:main.PickATransport2, id:AnyActorIdentity(ActorAddress(address: "[[ID]]"))

  _ = await Bug_CallsReadyTwice(transport: transport, wantBug: true)
  // CHECK: assign type:Bug_CallsReadyTwice, id:ActorAddress(address: "[[ID:.*]]")
  // CHECK:      ready actor:main.Bug_CallsReadyTwice, id:AnyActorIdentity(ActorAddress(address: "[[ID]]"))

      self.x = 1
    }
    self.x = 2
  }
}

@available(SwiftStdlib 5.5, *)
distributed actor Throwy {
  init(transport: ActorTransport, doThrow: Bool) throws {
    if doThrow {
      throw MyError.test
    }
  }
}

@available(SwiftStdlib 5.5, *)
distributed actor ThrowBeforeFullyInit {
  var x: Int
  init(transport: ActorTransport, doThrow: Bool) throws {
    if doThrow {
      throw MyError.test
    }
    self.x = 0
  }
}

