Restoring enum types after parsing