👽️ lib._type_check_impl sync with upstream
#804
+71
−108
Merged