But Illinois has one of the most explicit constitutional pension guarantees of any state. The State Supreme Court found that the landmark plan was unconstitutional, and interpreted the clause in a way that protects even benefits that current public workers have not yet earned, as well as cost-of-living adjustments for retirees.

That has made a dire situation worse and raised the possibility that Illinois, its biggest city and Chicago’s schools must all simultaneously find a way to keep running pension systems that are already unsustainable.

“What has happened is the loudest wake-up call possible,” said Laurence J. Msall, president of the Civic Federation, a watchdog group. “This is a financial tsunami for the City of Chicago and the State of Illinois that will not be fixed without politically painful changes.”

Many states and cities have been doing to a lesser degree what Illinois did: promising pensions without calculating the costs correctly or really preparing to pay them. Other states have pulled back from the brink of fiscal disaster through extraordinary measures, including New York in 1975, to deal with the threat of bankruptcy in New York City, and California in 2012, when Gov. Jerry Brown talked his famously tax-averse voters into approving a tax increase.

But the Illinois public pension system is at or near the bottom of national rankings. Standard & Poor’s Rating Services said in 2014 that the Illinois system was last among state systems, with just 40 cents available for every dollar of promised benefits.

The system sank over decades, as officials promised pensions without setting aside enough to pay them. In its unanimous opinion on May 8, the State Supreme Court cited commissions dating to 1917 that had warned of a crisis as more retired workers started drawing benefits.

Warnings were ignored, though, and shortfalls accumulated. It was easy for officials to let that happen because actuarial calculations can understate the true cost of a pension plan, and Illinois had some of the biggest actuarial distortions of any state. In 2013, Illinois became the second state in history, after New Jersey, to be accused of fraud by the Securities and Exchange Commission, which found that it had misled the public about the condition of its pension system.