generate-type-check-for-variable, clean up generate-type-check-for-value before combining the functions.