type_check moved into parser directory