computed-callee.ts 682 B

1234567891011
  1. // A callee selected by a COMPUTED index (`fns[i]`) must still dispatch to the tracked
  2. // arrow's summary: collapse carries function values through the widening, so this is a
  3. // resolved (widened, inexact) call, NOT an unknown call. `i` is const 0, so at runtime
  4. // the array's sole arrow is invoked with secret, whose ask reads it.
  5. // Expected: source -> ask#1 exact, ask#1 -> ask#2 INEXACT (computed-index widening clears
  6. // exactness); the call result is discarded so there is no ask#2 -> sink (return literal).
  7. const secret = await agent("s").ask<string>("secret");
  8. const fns = [(x: string) => agent("j").ask<string>(`judge ${x}`)];
  9. const i = 0;
  10. fns[i]!(secret);
  11. return "done";