Casting to a parametrized type with different parameter values?

In reply to dave_59:

The print() in the pseudocode I posted is simply a placeholder for a function in the parametrized class. I should’ve made myself more clear. :)