heap-aliasing-two-names-push-join.ts 401 B

12345678
  1. // Two names for one array: the ask is pushed through `ys`, the join reads `xs`.
  2. // Expected: ask#1 -> join#1 data (portless); ask#1 -> ask#2 and join#1 -> ask#2
  3. // (relay labels are additive); ask#2 -> sink.
  4. const xs: Node<string>[] = [];
  5. const ys = xs;
  6. ys.push(agent("writer").ask<string>("draft"));
  7. const parts = await Promise.all(xs);
  8. return agent("reader").ask<string>(`use ${parts.join(" ")}`);