Comment

Comment by teaearlgraycold

Very interesting. I’m shocked the typescript creators built a system with this failure mode. I guess the solution here is to have tsc change the type of “a” after the call to mutateArray, unless the arr argument is marked as readonly.

Is there a name for this failure mode?

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton