Over the last few days, constitutional debates around the executive order President Trump signed on Friday have focused on two very different questions. The first is whether the policy amounts to blatant religious or racial discrimination of the sort that, ordinarily, would clearly violate the Constitution. The second is whether those clear constitutional rules would give way because the discrimination appears in an immigration policy, rather than in domestic legislation—the theory being that immigration policies are somehow immune from constitutional scrutiny.

To see the stakes sharply, assume that David Cole’s argument in Just Security is correct: that Trump’s executive order contravenes black letter Establishment Clause doctrine both because the order is motivated by invidious intent to discriminate against Muslims and, even were it not, violates what Cole describes as the principle of denominational neutrality. Many other legal experts share Cole’s view, seeing the order as constitutionally indistinguishable from the policy Trump initially proposed as a candidate: a flat ban on entry to the United States by Muslims.

Ordinarily, a government policy that deliberately singles out members of a religious faith for unfavorable treatment because of their beliefs is obviously unconstitutional. Yet many have wondered whether the order, even if its amounts to such a discriminatory policy, is immune from attack because it is an immigration policy. Even a straightforward ban on Muslim immigration would be constitutionally permissible, Peter Spiro argued prominently in a New York Times Op-ed, citing the doctrine of “immigration plenary power” as the basis for his conclusions.

The so-called “plenary power” is too often assumed to spell death for any constitutional claim brought by immigrants seeking admission. That assumption is simply wrong. The “plenary power doctrine” is more of a rhetorical trope than a coherent judicial doctrine. So we should be suspicious of any argument that invoking the plenary power leads to clear black-letter consequences in law. That said, we can be confident that the plenary power does not stand for two things that it is often mistakenly claimed to stand for:

(1) The plenary power does not, as some seem to believe, stand for the proposition that noncitizens outside the US who have never touched foot here have no constitutional rights. It is a common myth that such folks are beyond the protection of our Constitution. But the idea that we have a strictly territorial Constitution—one that extends no further than our borders, has been time and again been rejected by the Supreme Court. Nor has the Court held that the only way the Constitution can apply abroad is in order to protect U.S. citizens. After all, just a few years ago the Supreme Court held that alleged enemy combatants housed at Guantanamo Bay—noncitizens who had never been in the United States—had constitutional rights to challenge their detention at GITMO. So even if it were true that Trump’s order applied only to noncitizens abroad who had no previous ties to the United States (in fact it is much broader, applying at least initially even to returning green card holders), that fact would not be sufficient for us to conclude that the Constitution clearly would not apply.

(2) The plenary power does not stand for the proposition that blatant (lawyers would say “facial”) discrimination on the basis of race, sex, religion, or ideology is constitutionally permissible in immigration policy. Some have argued that the plenary power would render any potential constitutional claim against Trump’s policy useless for this reason. And there is superficial appeal to this position. It is true that the canonical plenary power cases taught to law students around the country are, indeed, cases that upheld policies that blatantly discriminated on the basis of race, sex, ideology, and other grounds that ordinarily receive special protection under the First, Fifth, and Fourteenth Amendments. In Chae Chan Ping, the Supreme Court upheld the Chinese Exclusion Acts; in Harisiades v. Shaughnessy, it rejected a First Amendment challenge to the deportation of former members of the Communist Party; and in Fiallo v. Bell, the Court rejected an equal protection challenge to a sex classification that disadvantaged fathers in the green card preference system.

But what is too-often overlooked about these cases is when they were decided: each of them was decided during a constitutional era when such policies were often accepted as a matter of domestic law as well. Chae Chan Ping was decided seven years before Plessy v. Ferguson, which upheld Jim Crow segregation and birthed the infamous jurisprudential principle of “separate but equal.” Harisiades was decided in 1952, a period when First Amendment protections were much more watered down—and when communist party members were not infrequently criminally prosecuted. And Fiallo was handed down in the mid-1970s, during the nascent phase of the Court’s sex equality jurisprudence, when a number of domestic laws that discriminated on the basis of sex were upheld by the Supreme Court.

Since Brown v. Board of Education was decided in 1954, the Court assiduously avoided ever deciding, on the merits, the question whether the plenary power somehow insulates otherwise obviously unconstitutional racial or religious discrimination. Don’t let an immigration or constitutional law scholar tell you otherwise. Back in 1957, the Supreme Court did actually grant certiorari in what could have been the test case for whether open racial discrimination was permissible in immigration law. But the Court ducked the merits (not unlike its decision a few years later to avoid the precursor to Loving v. Virginia, a case attacking the constitutionality of anti-miscegenation laws). A few decades later it avoided the question again in Jean v. Nelson, a case challenging the Reagan administration’s treatment of unauthorized migrants from Haiti. The petitioners in that case attacked, as unconstitutional race discrimination, the administration’s policy of detaining arriving Haitians while releasing many arriving Cubans. The lower court reached the constitutional question, but the Supreme Court dodged it by concluding that the immigration statute and regulations themselves prohibited executive branch officials from considering race or national origin when making the decision whether to release arriving immigrants.

In short: the Supreme Court has never upheld an immigration policy that openly discriminated on the basis of race or religion during a period of constitutional history when such a policy would have been clearly unconstitutional in the domestic context.

The upshot is that there is a very good chance that the Supreme Court–and even more certainly many lower court judges–would strike down an immigration policy (even an admissions policy for people who have never entered the United States) if they see it as amounting to open discrimination on the basis of race or religion. And such a holding would not mean that courts were “abandoning” or walking back the plenary power. Instead, it would reflect the fact that the “plenary power” as actual constitutional doctrine is not nearly as coherent or categorical as discussions of the plenary power in both popular media and some corners of legal scholarship often suggest.

What’s more, this view of the so-called plenary power is testable—in fact, it is about to be tested. Just a few months ago, the Supreme Court heard argument in a case called Morales-Santana v. Lynch. That case involves a statutory provision for conferring citizenship on children born abroad that treats men worse than women—requiring that they have previously lived longer in the United States in order to pass on citizenship to their children. The policy cannot be explained by anything other than the perpetuation of outmoded sex-role stereotyping of the sort that the Supreme Court has repeatedly said is unconstitutional. In other words, most everyone agrees that this sex discrimination would amount a clear violation of equal protection were it contained in domestic legislation.

Will the Supreme Court sustain such a form of blatant discrimination in an immigration policy? The oral argument certainly provided hints that it will not—that even in the domain of immigration law, the Court will strike down government policies that it believes violate our Constitution’s core prohibitions on naked discrimination on the basis of sex or race or religion. If it does, then hopefully we can finally put to bed the misguided view about the immigration plenary power. In the meantime, the Trump administration is likely headed for a long court battle. And if the Executive Order is shown to involve invidious religious discrimination, the odds are stacked against them.

Image: Stephanie Keith / StringerGetty