digitalmars.D.learn - What is: Orphan format arguments: args[0..1]
- Charles Hixson via Digitalmars-d-learn (14/14) Mar 15 2015 What is: Orphan format arguments: args[0..1]
- anonymous (7/10) Mar 15 2015 It means you gave `format` more arguments than placeholders.
- Charles Hixson via Digitalmars-d-learn (2/11) Mar 15 2015 Thanks. (Actually it was like Python...but I had remembered it as D.)
What is: Orphan format arguments: args[0..1]
It appears to come from within unittest at the line:
string s = "{0}".format(cast(int)d2[i]);
d2 is:
ubyte d2[];
It should be 512 bytes long, but that hasn't been checked at the point
of the error.
The compilation used was:
rdmd --main -unittest -Dddocs blockf.d
(but dmd gave the same error on a slightly mover complex version)
The compiler was:
DMD64 D Compiler v2.066.1
Copyright (c) 1999-2014 by Digital Mars written by Walter Bright
and the system was debian testing Linux.
Mar 15 2015
On Sunday, 15 March 2015 at 18:46:52 UTC, Charles Hixson wrote:
What is: Orphan format arguments: args[0..1]
It appears to come from within unittest at the line:
string s = "{0}".format(cast(int)d2[i]);
It means you gave `format` more arguments than placeholders.
`format` uses C style % placeholders, not the brace syntax like
So make that:
string s = "%s".format(cast(int)d2[i]);
By the way, I don't see a need for the cast.
Mar 15 2015
On 03/15/2015 12:27 PM, anonymous via Digitalmars-d-learn wrote:On Sunday, 15 March 2015 at 18:46:52 UTC, Charles Hixson wrote:Thanks. (Actually it was like Python...but I had remembered it as D.)What is: Orphan format arguments: args[0..1] It appears to come from within unittest at the line: string s = "{0}".format(cast(int)d2[i]);It means you gave `format` more arguments than placeholders. `format` So make that: string s = "%s".format(cast(int)d2[i]); By the way, I don't see a need for the cast.
Mar 15 2015








Charles Hixson via Digitalmars-d-learn