downcasting function in Type (from general term to type)