Support casting to Class type