But for many younger progressives, the negative reactions to Mr. Sanders’s comments — ​which were also aired and debated in his 2016 presidential campaign — seem like boomer panic and a pernicious form of red-baiting, and reveal the divides within the Democratic Party.

“Socialism is a supposedly scary term that we’ve talked about so much, but we really don’t understand,” said Nolan Lok, 18, a chemistry major at the University of California, Los Angeles, where he cast a ballot early on Wednesday, ahead of its primary next week.

“In a society where technology is so important, where it takes fewer people to produce more things, we’re going to have to have a more socialistic society, where the government needs to step in more,” he said. “The government is going to be required to do more, and it’s something we should welcome, not be afraid of.”

This generational divide among Democrats was vividly apparent in interviews across the country this week assessing Mr. Sanders’s views and history, which included trips to the Soviet Union and Nicaragua as Burlington’s mayor as well as complimentary remarks about the Sandinistas. He has repudiated American foreign policy backing anti-Communist governments and resistance forces, and he has been fervently against war. But his remarks about Mr. Castro stand out, like his expression of amazement in 1989 that the Cubans he met “had almost a religious affection for him.”

Older liberals show varying support for Mr. Sanders’s positions, and the generational split was less apparent in South Florida, where many Cubans, Venezuelans and Nicaraguans do not like his views. Yet progressive voters born after the end of the Cold War — many of them people of color — dismissed the concerns about socialism as anachronistic and irrelevant.