Robin Williams, pictured last year, alleges he had a deal in which he'd be paid millions regardless of whether a movie was made. A judge in Los Angeles disagreed. Robin Williams, pictured last year, alleges he had a deal in which he'd be paid millions regardless of whether a movie was made. A judge in Los Angeles disagreed. (Matt Sayles/Associated Press)

Comedian Robin Williams has lost a $6 million US lawsuit he filed against an independent producer over an alleged deal to star in a film.

Through his company, Fiat Risus, the 58-year-old performer took Gold Circle Films to court in October 2008.

The actor claims he was hired to star in the comedic action film Cop Out (previously titled A Couple of Dicks) before the company decided to shelve the production.

Williams says he had a deal in which he would be paid whether or not the movie got made.

Later, Warner Bros. acquired the project and made the film starring Bruce Willis and Tracey Morgan. It is due to be released Feb. 26.

Los Angeles Superior Court Judge Joanne O'Donnell ruled in favour of Gold Circle this week after it produced e-mails indicating the company had not finalized a deal with Williams.

"It's unfortunate that Robin Williams' attorneys insisted on pursuing this lawsuit when it never should have been filed in the first place," said Gold Circle lawyer Michael Holtz.

Holtz says his clients will be seeking recovery of court costs from Williams.

There was no comment from the actor or his representatives about the matter.