A court challenge over a prime minister's right to leave Senate seats vacant indefinitely has been dismissed as moot.

The challenge by Vancouver lawyer Aniz Alani was launched in late 2014, when then-prime minister Stephen Harper made it clear he had no intention of filling Senate vacancies.

But Federal Court Justice James O'Reilly says the grounds for Alani's case evaporated once Justin Trudeau became prime minister last fall.

Story continues below advertisement

Trudeau created an independent advisory board to recommend non-partisan Senate appointees and has already appointed seven senators under the new process, with plans to fill the remaining 21 vacancies by the end of the year.

Alani had sought a court declaration that the prime minister has a constitutional obligation to fill Senate vacancies within a reasonable time.

Regardless of the change in government and approach, he had argued that it's still important for the court to clarify whether the prime minister has absolute discretion to fill Senate vacancies when – or if – he chooses.

O'Reilly disagreed.

"The case before me is inextricably connected to the moratorium on Senate appointments announced by the former prime minister," he said in a ruling released Thursday.

"That moratorium is clearly over. There is no live controversy remaining between the parties. Mr. Alani's case is moot."

O'Reilly further ordered Alani to pay the government's legal costs.

Story continues below advertisement

The justice did not rule on the merits of Alani's case, saying that would have required "weeks of analysis and writing" – time that could be better spent on cases where there is "a concrete and significant dispute that demands timely resolution."

"In addition, it is hard to see a significant social cost that the Canadian public would bear if the question Mr. Alani has raised went unanswered for now," O'Reilly added.

"Given the current circumstances, an answer may not be needed for several years, if ever."

Harper stopped appointing senators in March 2013, amid the Senate expenses scandal; there were 22 vacancies in the 105-seat chamber by the time Harper's Conservatives lost power last October. More seats have since fallen vacant as senators have retired.