fix #5889, clearer error when a non-Int number is used as a type parameter