Bug
Arrays of function types fail to compile. Example that fails:
const listeners: Array<(x: string) => void> = [];
listeners.push((x) => console.log(x));
listeners[0]("hi");
Error: function-pointer arrays not yet supported.
Impact
Forces stdlib/library authors into single-listener-per-event patterns instead of the idiomatic array-of-listeners event-emitter shape. Hit during the lib/net.ts implementation (PR #585) — Socket.on() had to be refactored to accept only one listener per event as a workaround.
Related
Ties directly to issue for arr[i](args) call expression rejection — together they block idiomatic event-emitter patterns.
Bug
Arrays of function types fail to compile. Example that fails:
Error:
function-pointer arrays not yet supported.Impact
Forces stdlib/library authors into single-listener-per-event patterns instead of the idiomatic array-of-listeners event-emitter shape. Hit during the
lib/net.tsimplementation (PR #585) —Socket.on()had to be refactored to accept only one listener per event as a workaround.Related
Ties directly to issue for
arr[i](args)call expression rejection — together they block idiomatic event-emitter patterns.