Perhaps you’ve seen the ads for Grand Casino, that Minnesota hub of gaming activity. They tend to feature real guests who have been lucky in love or winnings. One recent commercial featured a smiling guy who won a brand new Cadillac.

If you are a lucky winner of nearly any sort of contest or TV game show, you are bound to be a very happy camper. What you may not be fully aware of, however, is that when you win something as big as a $50,000 car, there are tax implications and you can be sure that tax officials will be watching to see that tax issues are resolved. Such matters are not ones to leave on the back burner. To avoid additional penalties and interest, it’s better to take action.

Not every act of largesse by a TV show host necessarily triggers tax obligations, however. This is something that comedian John Oliver recently put on display. In one episode of his popular show, “Last Week Tonight,” the British satirist aimed barbs at the debt-buying industry in the United States. He described how debt is often sold and written off and how lax government regulation makes it easy for unscrupulous companies to viciously go after unwitting consumers to collect alleged debt.

Oliver finds this unforgivable. To make his point he revealed that he had set up his own debt collection company and that he paid about $60,000 for nearly $15 million of medical debt for some 9,000 consumers. He then proceeded to forgive that debt by turning over the whole book of business to a non-profit organization called RIP Medical Debt, which handled the actual administration of the move.

Legal observers say the theory behind why this gift comes with no tax strings attached is that there’s a section of the IRS code that says, “no income shall be realized from the discharge of indebtedness to the extent that payment of the liability would have given rise to a deduction.”

In other words, the gift isn’t taxable because if the medical debt had been paid, the debtors might have been able to claim a deduction. Since the debt wasn’t paid, no deduction was claimed and the debtors realized no income as a result.

This may seem like splitting hairs to some. We suggest it’s more a matter of knowing the law.