fix toString on abstracts with type parameters (closes #2872)