Validate type of constant.