Rejection of House Republicans’ “compromise” immigration bill on June 27 by a lopsided 121-301 margin may be exactly what is needed to end the decades long immigration reform gridlock, if more-moderate House conservatives learn the right lesson from the bill’s failure.

The compromise bill was intended to attract support from these more moderate Republicans after a more restrictionist bill proposed by Rep. Bob Goodlatte (R-Va.), was defeated 193-231 the previous week. Neither of the bills received a single Democratic vote.

In truth the votes, rather than serious attempts to fix immigration policy, were just political theater in advance of this Fall’s midterm elections. Everyone involved knew that neither bill would attract the necessary Democratic support needed to pass the Senate.

Because Goodlatte’s bill, which would have created legal protection for fewer immigrants who were brought to the United States as children and more severely restricted future legal immigration, received greater support, there is danger that Republicans will believe that more restrictive immigration bills may have more of a chance of passing in the future.

Although President Trump ultimately supported the compromise bill, he had previously tweeted that “Republicans should stop wasting their time on Immigration until after we elect more Senators and Congressmen/women in November” and that “We can pass great legislation after the Red Wave!”

That’s exactly the wrong lesson. Republicans are so deeply divided on this issue that even if they gain seats in both houses of Congress, immigration reform would still require bipartisan support to become law. To get bipartisan support they’ll have to forgo the votes of those members of Congress who want to decrease legal immigration. Both recent proposals alienated Democrats with changes that would have decreased future legal immigration through existing family reunification visas.

Though you might not know it from the angry rhetoric, U.S. public opinion has been becoming more favorable, not less, on immigration in recent years. According the Gallup Poll that asks “Should Immigration Be Kept at Its Present Level, Increased, or Decreased?” 39 percent of respondents said immigration should be kept at current levels. While 29 percent said immigration levels should decrease, that number was down from 38 percent two years ago. Similarly, the 28 percent that said immigration should increase was up from 21 percent two years ago. Opinions have trended in these directions for decades and two years of President Trump’s rhetoric hasn’t changed this. As the opinions of voters continue their trend in this direction, politicians will ultimately follow.

Any immigration reform bill that stands a chance of becoming law, with the current Congress or in the foreseeable future, will need to be less restrictive than the ones the Republicans just proposed. That’s a good thing, not just for immigrants, but for native born Americans as well.

Economists who study immigration do not find the negative consequences that many people imagine. Immigration raises the income, on average, of the native born. Immigrants create about as many jobs as they take and they don’t depress wages of the vast majority of Americans.

Passable immigration reform today would likely trade funding for a border wall for a legal pathway to citizenship for immigrants brought to the United States illegally when they were children. Law and order Republicans could claim that they were securing the border and they could defend themselves against charges of “amnesty.” Since this reform only applies to people brought here as children, they could point out that when children break most other laws in the United States they are held to a lesser standard than adults and that this is no different.

Democrats would be wise to sign on to such deal too. Net migration from Mexico has been negative since the Great Recession. So, while symbolic, the wall would do little to change immigration numbers.

Such a reform would still leave 11 to 12 million immigrants, most of whom contribute to our overall prosperity, in the United States illegally. But no politically viable proposal is possible for them at the moment. Hopefully, if voters’ opinions continue to move in the direction they have been moving, even this may be possible in the future.