Guard parametric datatypes instantiated by non-first-class sorts (#8277)