California officials are hitting the panic button now that the economy’s coronavirus-induced free fall is imperiling local budgets and threatening to obliterate the value of the state’s pension funds. The state’s budget is highly dependent on capital-gains revenue and the pension funds are almost totally dependent on the stock market’s performance.

It’s a mess, albeit one that has long been coming. No one could have predicted that our society would essentially shut down in the face of a pandemic, but many observers — including former Gov. Jerry Brown — predicted the obvious: Whatever goes up eventually comes down, and it was only a matter of time before California faced a recession, especially after a record-setting bull market.

Many cities were in dire shape before the latest unpleasantness and, as the Southern Californa News Group’s Teri Sforza recently explained, will “have to fork over more to recover losses in pension funds, even as they’re still scrambling to fill the pension hole left by the last recession.” The mammoth California Public Employees’ Retirement System (CalPERS) was only 70-percent funded at the height of the market, which should have offered a clue.

Instead of fixing the pension system by scaling back future-going benefits, California officials ramped up state spending, dismissed pension reformers (we’re apparently just anti-union Chicken Littles) and pretended the fat times would go on forever. Ironically, California’s Legislature — the heart and soul of the Trump resistance — banked on the administration’s continued success at juicing the stock market.

“A preliminary analysis conducted by our office indicates a very high likelihood that tax revenues from capital gains income will be several billion dollars lower than what the governor’s budget assumed,” explained the nonpartisan Legislative Analyst’s Office in a March 18 report. The economics are far worse for the pension funds, whose values have dropped around 12 percent in recent days.

In the private sector, workers generally receive 401(k) plans. Employees contribute a portion of their paycheck into investment funds, with employers sometimes matching the contribution. When the market soars, employees do well. When it falls, they take a hit. That’s why most of us wisely are not checking our retirement accounts right now.

In the public sector, employees are guaranteed a pension based on a formula. It can’t be altered even during economic catastrophe. The pension funds invest in the markets and need to hit a predicted rate of return to keep the funds buoyant. CalPERS’ investments clearly were on track for a healthy return this year, but might now head into negative territory.

Public employees, who often enjoy six-figure retirements, won’t take a hit. Cities will have to boost their contributions to the fund, which means cutbacks in public services and higher local taxes. The state will divert more money from the general fund. CalPERS may be considering leaving the contribution rate steady for the next two years to reduce cities’ pain, but that will only kick the can down the road and ultimately exacerbate the shortfall.

Again, many reformers have been warning about these looming pension problems for years. “Everything we worried about is now here,” said Sen. John Moorlach, the Costa Mesa Republican who had predicted the Orange County bankruptcy and is the Capitol’s top pension expert. Moorlach has called for a shift from defined-benefit plans to 401(k) plans for public employees, but the union-controlled Legislature could never countenance such a heretical idea.

“We don’t want to wish for an economic downturn, a stock-market crash or another busted housing bubble,” I wrote last January, “but that appears to be the only hope right now to derail the coming spending train.” Indeed, the coronavirus panic will soon derail that train, like it or not. It would have been better, however, for lawmakers to have planned ahead.

No one expects a Democratic governor and Legislature to heed advice from fiscal conservatives, but they should have learned from not-so-distant history. In 1999, Gov. Gray Davis signed Senate Bill 400, which retroactively increased pensions for the California Highway Patrol by 50 percent — and sparked a statewide pension-increasing frenzy. The law’s backers insisted that it wouldn’t cost taxpayers a dime because stock market gains would pay for it all.

Then a funny thing happened. The nation entered a recession, the stock market dropped and the housing bubble burst. That’s why California cities—– few of which resisted the push to boost pensions — still are struggling to fill that previously dug hole. Here we are again, with yet another perfectly foreseeable perfect storm. No one can say officials weren’t warned.

California lawmakers can fix the volatility by fixing the pension system. They can shift public employees to 401(k) programs or adjust the so-called California Rule, which forbids government from reducing future benefits for current employees. Don’t expect them to make those hard choices. Instead you, dear taxpayer, will be forced to pay more to deal with our government’s shortsightedness.