The highly scientific answer to your question is, well, it depends. If we knew which specific light we were talking about, it would simplify the process. At any rate, here are a few things to consider. The number and severity of the impacts is the first consideration, regardless of which light is being used, insofar as the vast majority of taclights are made out of aluminum.
Obviously, if one good whack was all that was required, the chances of the damage being much more than cosmetic are greatly reduced. Any number of whacks significantly greater than that, and there are several ways the functioning of the light could be affected. Don't forget that most taclights are activated by some manipulation of the tailcap, precisely the area that is being most impacted. Many Surefires, for example, have rubber clicky switches on the end of the tailcap that could be easily damaged by even light pounding on an uneven steel object. Likewise, "twisty" tailcaps, though more durable in this scenario, still have fairly delicate thread patterns cut into their relatively soft aluminum bodies.
There is also the possibility that the inertia of the primary batteries could cause damage to the flashlight's internals, or even to the batteries themselves. This may be slightly more of a concern with LED lights as a circuit board is often located at the top end of the battery compartment.
Perhaps surprisingly, it may be the case that the bulb in a high quality taclight would suffer the least amount of damage in the scenario you present. Most of the top quality manufactures these days (Surefire, Pentagonlight, Streamlight, etc.) isolate their bulb and bezel assemblies from the shock associated with firearm recoil. In fact, many of these lights can be mounted directly to a firearm. So, even though beating on a lock presents different types of impact forces than those associated with rifle or pistol recoil, I can still see the bulbs surviving the ordeal relatively unscathed. Of course, when the discussion turns to LED bulbs, you can rest assured that these will likely survive any abuse that doesn't completely destroy the light.