Social justice activists and some members of the transgender community have responded angrily to the casting of Matt Bomer as a transgender prostitute in the upcoming Mark Ruffalo-produced drama Anything.

In posts on social media and in at least one essay on the subject, critics said the role of the transgender sex worker in the film should have gone to a transgender actor. According to Variety, Anything centers on a man (John Carroll Lynch) who, despondent over the death of his wife, moves from Mississippi to Los Angeles and strikes up a romantic relationship with a transgender sex worker.

Bomer, who is gay, is not transgender.

Activists quickly took to Twitter to criticize the casting choice:

Dear Matt Bomer,

You're great, but you're neither strong nor brave playing a trans character. You're just taking a role from a trans actor. — Cecil Baldwin (@CecilBaldwinIII) August 30, 2016

I really hope you both choose to do some actual good for the trans community one day. @MRodOfficial @MattBomer https://t.co/9WHwNu7HFm — Jamie Clayton (@MsJamieClayton) August 30, 2016

Matt Bomer playing a trans woman is the perfect example of how cis gay men throw us under the bus for capitalism and assimilation. — Raquel Willis (@RaquelWillis_) August 28, 2016

Dear @MarkRuffalo & @MattBomer: if you release this movie, it will directly lead to violence against already at risk trans women. — Jen Richards (@SmartAssJen) August 28, 2016

“With respect to your skilled work and sensitive portrayals of characters in the past, I beg you to shelve and scrap this film before you begin post-production,” trans musician and self-described social justice activist Mya Byrne wrote in an open letter addressed to Ruffalo, Lynch and Bomer. “That act will send a message to the Hollywood establishment: ‘We were wrong. We all need to do better and we have decided to set an example for others in our position.'”

Ruffalo responded to the criticism on his own Twitter account on Wednesday.

“To the Trans community. I hear you. It’s wrenching to you see you in this pain [sic],” he wrote. “I am glad we are having this conversation. It’s time.”

To the Trans community. I hear you. It's wrenching to you see you in this pain. I am glad we are having this conversation. It's time. — Mark Ruffalo (@MarkRuffalo) August 31, 2016

In all honesty I suggested Matt for the role after the profound experience I had with him while making "The Normal Heart". — Mark Ruffalo (@MarkRuffalo) August 31, 2016

Anything isn’t the only film to be criticized for casting so-called “cisgender,” or non-transgender actors, in transgender roles.

Last year, actress Michelle Rodriguez was cast as a transgender hitman in director Walter Hill’s upcoming film (Re)Assignment, and photos taken from the set in recent weeks have led to criticism that the role should have been cast with a transgender actor. Some have threatened to boycott the film.

Last year also saw the release of the Oscar-nominated film The Danish Girl, which starred Eddie Redmayne as transgender pioneer Lili Elbe. Critics also threatened to boycott that film ahead of its release in November. Redmayne was nominated for an Oscar for the performance, but lost out to The Revenant star Leonardo DiCaprio.

Follow Daniel Nussbaum on Twitter: @dznussbaum