If we can attribute the success of 2013’s “The Heat” to anything, it’s Melissa McCarthy and Sandra Bullock. McCarthy’s broad antics zigged where Bullock’s self-effacing humor zagged. They were an impeccable duo ― not to mention two of the only bankable movie stars working today.

But “The Heat” was actually written with Amy Poehler and Tina Fey in mind, the film’s screenwriter, Katie Dippold, told The Huffington Post this week while discussing the new “Ghostbusters,” which she wrote with Paul Feig.

Dippold was writing for “Parks and Recreation” when she composed “The Heat” with the hopes of selling it to a Hollywood production company. After the group behind “Rise of the Planet of the Apes” and “Oblivion” ponied up a reported six-figure sum for the script, Dippold called Feig her “dream director.” She was convinced he wouldn’t want to do another female-driven comedy after making “Bridesmaids,” but the producers sent him the script anyway. Much to Dippold’s surprise, he signed on.

Gilbert Carrasquillo via Getty Images

With “role models” Poehler and Fey in mind, Dippold discussed the casting with Feig. He said he had been seeking a lead project for McCarthy, so why not this one? McCarthy, in turn, was looking to make a movie with Bullock. It was fate: As Dippold was writing, despite her interest in Poelher and Fey, she had found herself also thinking of McCarthy, whose Oscar-nominated “Bridesmaids” performance she called “one of the funniest of this lifetime.”

“If you read the first draft, every now and then something starts to feel more like Melissa,” Dippold said.

Had they pitched the movie to Fey and Poehler, Fey would have played Bullock’s FBI-agent part and Poehler would have assumed McCarthy’s foulmouthed police-officer role.

“Amy Poehler is such a great actress, and there are so many sides of her, so her as a rogue, tough cop, I thought would have been great,” Dippold said. “But then it got to Paul and he wanted Melissa, and there’s no arguing that. ‘Oh, sure, Melissa and Sandra Bullock?’ I remember the producer, Jenno Topping, was like, ‘Why don’t we give Sandy a call?’ And, first of all, I’d never heard ‘Sandy’ before, so I was like, ‘Sure, let’s try Sandy.’ I immediately picked that up. I was psyched.”

Would “The Heat” have been as successful with Tina and Amy on board? Compare its $230 million worldwide gross to “Sisters,” which earned $105 million last year after opening opposite “Star Wars: The Force Awakens.” They’re beloved, but Fey and Poehler are not the same certifiable movie stars that McCarthy and Bullock are, even when coupled. Plus, no one delivers F-bombs as judiciously as McCarthy.

“Ghostbusters,” which also stars McCarthy (and a bunch of other hilarious women), opens July 15.