From California comes a terrible case of a rape conviction overturned because of an outdated law: According to the appeals court's interpretation of state law, tricking someone into having sex with you by pretending to be someone else is only illegal if the rapist is pretending to be your husband.

Here's the case: A woman and her boyfriend go to a party, come home and go to bed. The boyfriend leaves the room after she falls asleep, and a man named Julio Morales comes in. He knows she's asleep and starts having sex with her. When she wakes up and realizes Morales isn't her boyfriend, she starts resisting and Morales runs away. She pressed charges and Morales was sentenced to three years in prison.

But Morales' lawyer appealed the case. As this Salon piece spells out, it's not up for debate that the victim was asleep, that Morales started having sex with her while she was unconscious, and that the sex was nonconsensual. But:

California law only explicitly makes it a crime to trick someone into having sex if she believes she’s having sex with her husband. That’s technically true of the law. The judges said that because they couldn’t be sure whether the jury had convicted Morales based on correct theory (that she was unconscious) rather than the incorrect one (he pretended to be someone else), the whole case had to be retried.

When the case law was written, in 1872, "rape was an act of sexual intercourse accomplished with a female not the wife of the perpetrator." The judges seem dismal about their verdict in their official opinion, which reads: "We reluctantly hold that a person who accomplishes sexual intercourse by impersonating someone other than a married victimโ€Ÿs spouse is not guilty of the crime of rape of an unconscious person."

Oregon rape laws, thankfully, don't contain provisions about marital status of the victim.

Now, Morales will be retried on the grounds that he had sex with someone who couldn't consent, not that he was impersonating her boyfriend. But, in the meantime, California has some law-changing to do.