added test and started typecheck visitor