fixes treatment of type parameters in traits