fix ineffective polymorphic_type in template