chained-assign.ts 502 B

1234567891011
  1. // Chained assignment `x = y = t` taints BOTH targets (nested EqualsToken). Positive
  2. // coverage locking in the currently-correct behavior so a fix to the sibling
  3. // compound/destructuring-assignment bugs cannot regress it.
  4. // Expected: ask#1 -> ask#2, ask#1 -> ask#3, and both -> sink.
  5. const t = await agent("alpha").ask<string>("one");
  6. let x = "";
  7. let y = "";
  8. x = y = t;
  9. const b = await agent("beta").ask<string>(`X: ${x}`);
  10. const c = await agent("gamma").ask<string>(`Y: ${y}`);
  11. return `${b} ${c}`;