Undefined should be of any type in type checking, fixes #338