Depending on what you're trying to achieve, there may be a better solution.
But what you're asking is also possible, using the constraints package.
{-# LANGUAGE FlexibleContexts, ConstraintKinds, MultiParamTypeClasses #-}
import Data.Constraint.Forall
class Test a b
test :: Forall (Test a) => a -> a
test = undefined