A California appeals court overturned five men’s convictions for possessing cannabis in prison, ruling that the Golden State’s adult-use law applies to all adults equally, even if they are behind bars.

The case involves five defendants who were convicted of possessing weed in prison, a felony punishable by an additional two to four years of imprisonment. The defendants filed a petition to have these convictions dismissed, arguing that possession of an ounce or less of cannabis is now legal in California. The petition was denied by the Sacramento State Court, but the defendants contested to the California Court of Appeals for the Third Appellate District.

On Tuesday, the appeals court reversed the former court’s decision, overturning the convictions for all five defendants. “According to the plain language of Health and Safety Code section 11362.1, enacted as part of Proposition 64, possession of less than an ounce of cannabis in prison is no longer a felony,” Presiding Justice Vance W. Raye said in his ruling. Smoking or otherwise ingesting cannabis in prison does remain a felony, however. In other words, this doesn’t mean that inmates can get high in slammer. And in federal prisons, possesion is still prohibited. 

“The plain language of Proposition 64 is clear,” Raye continued, adding that the precedent established in similar cases leads “to the inescapable conclusion that possession of less than one ounce of cannabis in prison or a similar penal institution is not a felony.”

The Attorney General argued that the plain meaning of the adult-use law is more complicated than it seems, using an obscure statutory rule called “the Nearest-Reasonable-Referent Canon” to argue that Prop. 64 does not apply to inmates of penal institutions. In response, Raye wrote that “the Attorney General uses arcane rules of statutory construction, twists the meaning of the words of the statute, urges us to disapprove of cases directly on point, and makes a host of policy arguments why we should not apply the plain language of the statute.”

The Attorney General’s “argument flies in the face of the plain language of the statute and common sense,” the ruling reads. “We cannot ignore binding precedent and the plain language of a statute based on the intensity of the Attorney General’s passion to criminalize an act the electorate has decided no longer merits treatment as a felony.”

The ruling requires that the five defendants — Goldy Raybon, Anthony Cooper, Dwain Davis, Scott Haynes and James Potter — be granted petitions for relief from their convictions.