// A struct with the same field names and types is not an Edge: the spawn // argument is matched to the target's parameter BY NAME (D19 rule 2), so only // the universe type satisfies it. // // expected: the spawn argument and the target parameter must agree package main type Req struct { Body []byte `cap:"1024"` } type FakeEdge struct { Recv Receiver[Req] Send Sender[int32] } func worker(ep Edge[Req, int32]) (closed chan struct{}) { for { select { case <-closed: return closed case r := <-ep.Recv: _ = r } } } func main() { select { case <-shutdown: return default: } parent, child := edge[int32, Req]{2} _ = child var fake FakeEdge done := spawn(worker, fake) close(parent.Send) <-done }