Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If that's true, then how is a type like this (non-empty array) useful at all, if it can't be relied on at runtime?

TS should say, you can't pop() this array, unless TS can infer it has >1 elements. Otherwise it can enter a state at runtime which doesn't conform to the type. That seems bad!



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: