Expand and implement Note [The tcType invariant]
Read that note -- it's necessary to make sure that we can always call typeKind without panicking. As discussed on #14873, there were more checks and zonking to do, implemented here. There are no known bugs fixed by this patch, but there are likely unknown ones.
Showing with 48 additions and 29 deletions