A federal judge is raising an alarm about “judicial psychoanalysis” resulting from the 9th U.S. Circuit Court of Appeals ruling on President Donald Trump’s executive order on “extreme vetting.”

Last week, the 9th Circuit voted against rehearing the case that a three-judge panel had previously ruled on in affirming the federal district judge’s temporary restraining order on Trump’s first executive order on immigration restrictions.

The panel in part applied the Trump campaign’s assertion for a “total and complete shutdown of Muslims entering the United States until our country’s representatives can figure out what is going on.”

Applying campaign statements when interpreting law “sows chaos,” said Judge Alex Kozinski, who has been on the 9th Circuit since 1985, in his dissent.

“Does a ‘Meet the Press’ interview cancel out an appearance on ‘Face the Nation’?” Kozinski asked rhetorically. “Does a year-old presidential proclamation equal three recent statements from the Cabinet? What is the appropriate place of an overzealous senior thesis or a poorly selected yearbook quote? Weighing these imponderables is precisely the kind of ‘judicial psychoanalysis’ that the Supreme Court has told us to avoid.”

The judge also wrote:

No Supreme Court case—indeed no case anywhere that I am aware of—sweeps so widely in probing politicians for unconstitutional motives. And why stop with the campaign? Personal histories, public and private, can become a scavenger hunt for statements that a clever lawyer can characterize as proof of a -phobia or an -ism, with the prefix depending on the constitutional challenge of the day. This path is strewn with danger.

Even during the campaign, Trump modified the proposal as part of his 100-day plan to “suspend immigration from terror-prone regions where vetting cannot safely occur. All vetting of people coming into our country will be considered ‘extreme vetting.’”

Trump’s executive order in January identified seven countries that are majority Muslim, but have also been failed states that the Obama administration labeled “countries of concern—Iraq, Iran, Syria, Libya, Sudan, Somalia, and Yemen. The order left other Muslim-majority countries such as Saudi Arabia and Qatar off the list.

The state of Minnesota joined the lawsuit initiated by Washington state to block the executive order. The Trump administration crafted a second executive order—which among other things didn’t include Iraq on the list of countries. However, after a federal judge in Hawaii struck the second executive order down, Trump vowed to defend the first order all the way to the Supreme Court.

In the 9th Circuit decision, the court held on Feb. 9:

In support of this argument, the States have offered evidence of numerous statements by the president about his intent to implement a “Muslim ban” as well as evidence they claim suggests that the executive order was intended to be that ban … It is well established that evidence of purpose beyond the face of the challenged law may be considered in evaluating Establishment and Equal Protection Clause claims.

Such questions about campaign rhetoric—as a legal precedent—can be tricky, said J. Christian Adams, a former Justice Department attorney in the Civil Rights Division.

“Finding racial and discriminatory intent is not an easy task,” Adams, now the president of the Public Interest Legal Foundation, told The Daily Signal. He added, “It is not totally outlandish to cite comments made by a political candidate in the campaign.”

However, in the case of Trump, Adams said the courts seem to be following a “left-wing narrative” that Trump is anti-Muslim, when nothing in the order, nor what he said in the campaign, is actually anti-Muslim.

The 9th Circuit majority cited three Supreme Court cases displaying precedent that “evidence of purpose beyond the face of the challenged law” can be applied in interpreting the intent of a measure. The 1977 case of Village of Arlington Heights v. Metropolitan Housing Development Corporation, the 1982 case of Larson v. Valente, and the 1993 case of Church of the Lukumi Babalu Aye v. City of Hialeah applied to evidence outside the actual written letter.

In the Village of Arlington Heights case, the high court ruled:

Determining whether invidious discriminatory purpose was a motivating factor demands a sensitive inquiry into such circumstantial and direct evidence of intent as may be available … The legislative or administrative history may be highly relevant, especially where there are contemporary statements by members of the decision-making body.

However, those cases pertained to deliberations in making the law rather than campaign promises, noted Bradley Smith, chairman of the Center for Competitive Politics, a group that opposes restrictions on campaign speech.

“It’s definitely unusual for judges to use campaign statements to define whether an action is constitutional,” Smith, a former chairman of the Federal Election Commission, told The Daily Signal. “I doubt it would chill campaign speech, but it is a dangerous path. This could be very selectively enforced for candidates that use shorthand or off-the-cuff remarks. Already political discourse is too scripted. If this becomes a precedent, it will mean no spontaneity and pure teleprompter.”

Kozinski further noted that such judicial application to campaign statements “will chill campaign speech.” Kozinski wrote:

Even if a politician’s past statements were utterly clear and consistent, using them to yield a specific constitutional violation would suggest an absurd result—namely, that the policies of an elected official can be forever held hostage by the unguarded declarations of a candidate. If a court were to find that campaign skeletons prevented an official from pursuing otherwise constitutional policies, what could he do to cure the defect? Could he stand up and recant it all (‘Just kidding!’) and try again? Or would we also need a court to police the sincerity of that mea culpa—piercing into the public official’s ‘heart of hearts’ to divine whether he really changed his mind, just as the Supreme Court has warned us not to?

It’s generally inappropriate not to judge the executive order on its face, said Hans von Spakovsky, a senior legal fellow at The Heritage Foundation.

“The logical end result is that an action by one president could be determined legal and constitutional, but the same action by another president could be determined illegal and unconstitutional, based on what they said in the campaign,” von Spakovsky told The Daily Signal.