One of President Donald Trump’s nominees for the federal judiciary previously said in a speech that he discriminates against gay people, according to a new report from Vice.

“Guess what? I attend a conservative Baptist church. We discriminate, all right. On the basis of sexual orientation, we discriminate,” Jeff Mateer said in a 2015 speech at the National Religious Liberties Conference. “Does that mean I can’t be a judge? In some states, I think that’s true, unfortunately.”

Here is audio of several of Mateer’s remarks, which Vice compiled from two speeches:

Mateer is the first assistant attorney general in Texas. Trump nominated him to the US District Court for the Eastern District of Texas.

The remark isn’t the only anti-LGBTQ comment Mateer has made over the years. He also argued that same-sex marriage is unconstitutional, that marriage equality is a “challenge” for Christians, and that transgender children are part of “Satan’s plan.” (He did not respond to Vice’s request for comment.)

Dozens of LGBTQ organizations signed on to a letter to senators calling on them to reject Mateer’s nomination. The Senate must approve the nomination before Mateer can serve on the bench.

Mateer’s comments, though, reveal an uncomfortable truth about US law: Texas and most other states don’t ban discrimination based on sexual orientation or gender identity in the workplace, housing, or public accommodations (hotels, restaurants, and other places that serve the public).

But the courts are now hearing challenges as to whether anti-LGBTQ discrimination is, in fact, already illegal under federal law — which is one reason why Mateer’s views here could play a role in his nomination.

Most states don’t explicitly ban anti-LGBTQ discrimination

Under federal and most states’ laws, LGBTQ people aren’t explicitly protected from discrimination in the workplace, housing, or public accommodations. This means that someone can be fired from a job, evicted from a home, or kicked out of a business just because an employer, landlord, or business owner doesn’t approve of the person’s sexual orientation or gender identity.

But federal and state laws do ban discrimination based on race, religion, nationality, and sex in the workplace and other settings. This is what the Civil Rights Act and other federal and state civil rights laws that followed were about.

Civil rights advocates claim, however, that federal law should already shield LGBTQ people from discrimination, because, they say, bans on sex discrimination also ban discrimination based on sexual orientation and gender identity.

According to advocates, discrimination against people based on their sexual orientation or gender identity is fundamentally rooted in prohibited sex-based expectations. For example, if someone discriminates against a gay man, that’s largely based on the expectation that a man should only love or have sex with a woman — a belief built on the idea of what a person of a certain sex should be like. Similarly, if someone discriminates against a trans woman, that’s largely based on the expectation that a person designated male at birth should identify as a man — again, a belief built on the idea of what a person of a certain sex assigned at birth should be like.

On the other side, opponents argue that LGBTQ nondiscrimination protections aren’t included in existing federal civil rights laws, because the authors of federal civil rights laws never believed or intended that bans on sex discrimination also ban discrimination based on sexual orientation and gender identity.

LGBTQ advocates, citing legal precedent, say that what the original laws’ authors believe or intended is irrelevant. Joshua Block, an attorney with the ACLU LGBT and HIV Project, cited a 1998 Supreme Court case, Oncale v. Sundowner Offshore Services Inc., in which the Court unanimously agreed that bans on sex discrimination prohibit same-sex sexual harassment. Same-sex sexual harassment was not something the authors of federal civil rights laws considered, but it’s something, the Supreme Court said, that a plain reading of the law protects.

“Oncale says that’s irrelevant whether [Congress] contemplated it,” Block previously told me. “This is literal sex discrimination. Whether or not that’s what Congress was focused on doesn’t make it any less a type of discrimination covered by the statute.”

One catch: Even if courts conclude that statutory bans on sex discrimination do prohibit discrimination based on sexual orientation and gender identity, under federal law that would only create explicit protections in the workplace, housing, and schools — but not public accommodations. That’s because federal civil rights laws don’t ban sex discrimination in public accommodations, leaving a hole in nondiscrimination laws at the federal level for LGBTQ rights.

As legal challenges continue, courts will decide which interpretation of federal civil rights law is right. So that a judicial nominee like Mateer seems so comfortable with anti-LGBTQ discrimination is very alarming to civil rights advocates.