chasing down bug in type checker