Are you sure you’re not thinking of the case of R. v. Ladue from Yukon, in Canada?
As I posted in a long-ago thread, Is Necrophilia illegal (subtitle: Ewwww…):