David Cameron is on the verge of making a historic error. The Sunday Times says the British prime minister has already decided to set an annual cap on the number of Continental Europeans who are legally entitled to work in the country. But it seems more likely that he is still agonizing over exactly what to say on immigration in a speech promised before the end of the year.

The snag is that imposing quotas would infringe on the European Union treaty commitment to allow free movement of people. If Britain just goes ahead and stops people from going there to work, it will be hauled up in front of the European Court of Justice.

More likely, Mr. Cameron will seek to secure the right to set a cap on immigration as part of his plan to renegotiate Britain’s relationship with the European Union before holding a referendum on whether the country should stay in the 28-nation bloc. The problem is that it is inconceivable that he can negotiate such a deal.

Therefore, if the prime minister commits himself to getting the right to impose quotas, the logic of his position will force him to campaign to quit the union — assuming, that is, he wins next year’s general election and is in a position to hold his promised in/out referendum.