[asdl] Generate type_id() method for variant types