Set the type of a variable