The real question about this romcom, yet another about a couple obviously destined to fall in love who instead spend most of the running-time trying to be just friends, is: what if the attractive cast had been handed a good script? Daniel Radcliffe and Zoe Kazan are pleasant, attractive young people and work hard to give the movie a spark—as does the interesting supporting cast. But the basic plot is brainless, and barely a sentence of the dialogue sounds as though it might actually ever be spoken by a human being—it’s just too cute and clever by half, the sort of stuff that tumbles from the fingers of writers weaned on sitcoms. It’s also strangely raunchy—why all the references to excrement, for example, though they’re all sanitized by referring to it naughtily as “poop” or smugly as “feces”? Whatever word is used, they all point to a poverty of imagination on the part of scripter Elan Mastai (adapting a play called “Toothpaste and Cigars” by T.J. Dawe and Michael Rinaldi). (A similar lack of courage is shown by the distributor’s decision to change the title from “The F Word,” under which it was screened at the Toronto Film Festival. “F” for “Friends,” get it?)

We first encounter Wallace (Radcliffe) clambering atop the roof of the Toronto house where he lives with his sister (Jemima Rooper) and her young son Felix (Lucius Hoyos). Turning on his cellphone, the sad-sack fellow listens again to the message left more than a year earlier by the girlfriend who cheated on him, which led him to drop out of the med school they both attended. (The gag is an updating of one from Arthur Hiller’s “The Lonely Guy,” where it was fresh and better used.) Since then he’s eked out a kind of living writing instructional manuals. But at a party thrown by his old college roommate (and still best friend) Allan (Adam Driver), the pathetic fellow meets Allan’s cousin Chantry (Kazan), with whom he has an instant rapport. Wallace thinks it might evolve into something more, but finds out that Chantry, a successful animator whose drawings occasionally float across the screen to give the otherwise earthbound picture some visual pizzazz, has a happy homelife with her long-time boyfriend Ben (Rafe Spall), who’s in the Canadian diplomatic service.

But that doesn’t stop Wallace and Chantry from developing a friendship that both intend to remain strictly platonic. Of course it’s a struggle for them both, since their attraction is clearly getting serious despite the efforts of both to keep it in check. We watch with increasing dismay as the script repeatedly replays scenes of Wallace desperately trying to restrain himself and Chantry questioning her commitment to Ben after he takes a long-term assignment in Europe and she’s offered a promotion that will take her to Asia. Matters certainly aren’t helped by intervention from fast-talking Allan and his high-spirited girlfriend (later wife) Nicole (Mackenzie Davis) and Chantry’s libidinous sister Dalia (Megan Park). The fact that Wallace, whose parents cheated on one another, has a phobia about becoming the third part of a romantic triangle and following in their footsteps is, moreover, matched by Chantry’s horror at the idea that he’s been manipulating her to nudge along a break-up with Ben so that he can be with her. Naturally everything works out in the end.

If all this sounds trite and formulaic, that’s because it is. The makers try to camouflage things with loads of self-consciously “cool” dialogue, and the cast—especially Radcliffe—deliver it at a rapid-fire clip that director Michael Dowse apparently intends to recall the spitfire approach of forties screwball comedy, but the lines are mostly uninspired and the swift pace feels more desperate than enlivening. That doesn’t mean that Radcliffe and Kazan don’t remain likable presences. The “Harry Potter” kid has been proving that there’s life after Hogwarts for him for some time now, and shows that he can handle romantic leading man status, even in inferior material. Kazan looks a bit wan compared to her turn in “Ruby Sparks,” which she had the benefit of writing herself (as well as playing against her real-life significant other Paul Dano, who always brings out the best in his co-stars), but she remains an ingratiating presence. The supporting players are good as well, with Driver showing particular promise as Wallace’s down-to-earth pal, even if he’s stuck with some of the most implausible lines. At the other end of the spectrum is Spall, who fails to find just the right balance between charm and oiliness.

Rogier Stoffers’ cinematography presents Toronto as a nice setting for the picture—it’s a special pleasure to see the city playing itself rather than standing in for New York or another US city. The other technical credits are solid down the line.

In fact, “What If” has so many good ingredients that it’s sad to see it wind up as unappetizing as the “Fool’s Gold” sandwich it repeatedly brings up in connection with Elvis Presley’s death. The formulaic premise and self-indulgent writing defeat the best efforts of a likable cast.