With recreational marijuana slated to become legal next year, provincial governments are determined to keep the sale of weed completely separate from the sale of alcohol, establishing dedicated cannabis retail outlets. But alcohol and marijuana companies have fewer reservations about joining forces. Constellation Brands, the owner of Corona and a large number of wine and spirits labels, purchased a 9.9 per cent stake in Canopy Growth Corp. for $245 million this week. The investment in Canopy, Canada’s biggest cannabis producer, marks the first deal of its kind—but it won’t be the last. Other alcohol conglomerates are likely to diversify into marijuana to help offset weak sales.

Constellation CEO Rob Sands said in a statement the deal was about “identifying early stage consumer trends.” Behind the bland corporate jargon is a legitimate concern about the implications of legalized marijuana. Consumers could drink less alcohol in favour of smoking weed. Sales of some beer brands even dipped slightly in Colorado, Washington and Oregon after these states legalized recreational marijuana. “It looks like cannabis is a substitute for alcohol as opposed to a parallel product,” says Jason Zandberg, an equity analyst at PI Financial Corp. in Vancouver.

Anderson Economic Group, a U.S. consultancy, estimated earlier this year that legalization could cost Canada’s $22.1-billion alcohol sector about $160 million in sales initially, less than one per cent. That doesn’t seem like much, but shareholders demand constant growth. The industry is also facing other challenges outside of marijuana. Beer sales are still growing in Canada in terms of dollar value, but the volume of suds is declining, suggesting brewers are relying on higher prices. Established brands are threatened by the boom in craft brews, and wine and spirits are taking up more market share. In Ontario, for example, around 82 per cent of 18- to 29-year-olds consumed alcohol in 2015, according to a report from equity research firm Cowen and Co. That’s down 5.5 per cent since 2008. Marijuana use is steady at between 34 and 36 per cent, and is expected to increase after legalization by some accounts.

Molson Coors Brewing Co. has been introducing higher-priced craft and flavoured beer but volume has been falling for six years in Canada, and for eight years in the United States. The company is even experimenting with launching brewpubs under the name Batch. Molson Coors opened the first Batch location in Toronto last year, and has plans to expand to other cities around the world. If Molson Coors can branch into the restaurant business in search of growth, investing in a marijuana company doesn’t seem like much of a stretch. (A spokesperson told Bloomberg the company is focused on its current portfolio, but is watching the marijuana space.) Shares in large Canadian cannabis companies surged this week in anticipation of similar deals.

For alcohol conglomerates, Canada is a perfect testing ground for recreational marijuana. Studying how the market works here can give companies an advantage in the U.S., should cannabis become legal at the federal level. Canopy in particular is establishing itself as an international player. It exports small amounts of cannabis to German pharmacies, purchased stakes in medical cannabis companies in Australia and Chile, and partnered with two firms in Brazil.

The marijuana industry can benefit from the arrangement, too. Zandberg points out that alcohol companies are experts at developing and promoting consumer brands, something that cannabis firms, until now confined to the medical space, haven’t done before. (The need for branding expertise explains why Emblem Corp., another Canadian licensed producer, recently poached the head of ad agency KBS Canada to become its new CEO starting next year.) Companies like Constellation also have significant experience dealing with provincial liquor control boards—the same entities that will oversee retail and distribution for cannabis.

And then there’s the possibility of cannabis-based beverages, which Constellation and Canopy intend to develop. The market for such products is tiny today, but could grow rapidly, according to Zandberg. Edibles account for about 15 per cent of sales in the U.S., and infused beverages account for just seven per cent of that share. One drawback is that cannabis-infused beverages take a long time to produce an effect, unlike drinking alcohol. “If that can be achieved, that would make infused beverages a lot more popular,” Zandberg says.

The federal government in Canada doesn’t plan to legalize edibles until at least 2019, providing many more months for companies to solve this vexing issue—and more time for alcohol companies to stake a claim.