Chae Chan Ping’s name doesn’t appear in either the government’s petition for review or the state of Hawaii’s reply, but his ghost haunts the pleadings.

His ghost can be heard, also, in Trump’s recent suggestion that the United States should bar immigration from African countries and Haiti in order to substitute immigrants from Norway, or when government lawyers argue that the constitutional rules against decisions based on race, national origin, and even religious discrimination simply do not apply to immigration matters, and that courts may not meddle in immigration matters

Lawyers call that the “plenary power” doctrine. In 1977, the Supreme Court stated it thus: “‘Over no conceivable subject is the legislative power of Congress more complete than it is over’ the admission of aliens.” Thus, the Court said in 2003, “Congress may make rules as to aliens that would be unacceptable if applied to citizens.”

How did we get here? Chae Chan Ping came to the U.S, legally, in 1875 to work as a laborer in San Francisco. At that time, the U.S. by treaty guaranteed to Chinese people the “natural right” to immigrate to the U.S., though not to become naturalized citizens.

After 12 years, he returned to China for a visit in June 1885. By that time, the political winds had turned against the Chinese; in 1882, Congress passed the Chinese Exclusion Act, barring new immigration by Chinese people. Its first version, however, allowed Chinese already present in the U.S. to remain, even if they returned home for an occasional visit. Before Chae Chan Ping left for China, he followed that law carefully, obtaining from the government a certificate stating that he lived in the U.S. and was legally entitled to return. He sailed off to Hong Kong on the steamer Belgic, and returned more than a year later on the same vessel. But while he was on that homeward voyage, Congress tightened the screws further. As of a week before his arrival, certificates of return were rendered void. Customs officers at the port of San Francisco refused to allow him back into the U.S.

As outlined in a readable summary by the University of California Davis law professor Gabriel J. Chin, Chinese benevolent societies had amassed a legal-defense fund for immigration cases. Thus, Chae Chan Ping’s appeal to the Supreme Court was brought by a “‘Dream Team’ of elite lawyers.” They argued that the certificate granted him a vested right to return, and that revoking that right would be a taking of property without due process. They did not argue that Congress could not exclude new immigrants from China; indeed, they wrote in their brief, “we do not deny the plenary power of Congress over the treaty and over its own legislation so as to forbid the future immigration of Chinese laborers, and the future issue of certifications…”