overloaded-function-values.ts:17:17 - error SC2007: values of type '{ (event: "exit", code: number): void; (event: "data"): string; }' cannot be compiled: the type declares multiple call signatures (overloads), and a compiled function value is always one concrete signature

  16 | // chain would compile to Node's ReferenceError at the root instead).
  17 | function attach(on: { (event: "exit", code: number): void; (event: "data"): string }): void {
     |                 ^~
  18 |   on("exit", 0);

  hint: annotate the slot with the ONE signature the program actually calls (e.g. '(x: number) => string'), or wrap the overloaded function in a single-signature arrow

overloaded-function-values.ts:20:1 - error SC2004: uses of 'attach' inherit the blocker on its declaration

  19 | }
  20 | attach(((() => "") as unknown) as { (event: "exit", code: number): void; (event: "data"): string });
     | ^~~~~~
  21 | 

  hint: the declaration of 'attach' did not compile — fix the diagnostic reported there and these sites clear with it