I mean, it is from the deadly nightshade family, after all. It's their own natural pesticide. Think all of them have this alkaloid toxin, just in varying amounts. Tomatoes are one of the more benign ones (grown varieties mostly have relatively harmless tomatine, IIRC, with only very tiny amounts of solanine), but eating a few pounds of the greens might probably still cause problems. Don't try it, regardless.
(Though cattle are known to get away with it. For tomato vines, I mean.)