Raise a compile error when accessing this function and throws a TypeError at runtime
This is useful for exhaustive switch check.
@example
const print =(fruit:'banana'|'kiwi')=>{ switch(fruit){ case'banana':return'🍌 Banana'; case'kiwi':return'🥝 Kiwi'; default:returnassertNever(fruit);// <- This line will report an error if a case is missing } }
Raise a compile error when accessing this function and throws a TypeError at runtime This is useful for exhaustive switch check.