rename to isTypeDecl for consistency
fix test
move emit out of loop for clarity