Bug w/tuple of custom types?

Magnus Lie Hetland magnus at hetland.org
Mon Mar 21 10:03:25 PDT 2011


Sample program:

import std.typecons;

typedef uint oid_t;

void main() {
    Tuple!(uint,uint) key;
    // Tuple!(oid_t,oid_t) key; // Doesn't work
}

If I use the last tuple instead of the first, I get the following 
compiler error with DMD 2.052 in OS X:

/path/to/src/phobos/std/format.d(1579): Error: function 
std.format.formatValue!(Appender!(string),oid_t,immutable(char)).formatValue 
is deprecated
/path/to/src/phobos/std/format.d(306): Error: template instance 
std.format.formatGeneric!(Appender!(string),oid_t,immutable(char)) 
error instantiating
/path/to/src/phobos/std/typecons.d(507):        instantiated from here: 
formattedWrite!(Appender!(string),immutable(char),oid_t)

It seems that std.typecons is using a deprecated formatting API, which 
is triggered by my use of a custom type? And ... I guess this would be 
a bug? (I looked in the tracker, and couldn't find it there already.)

-- 
Magnus Lie Hetland
http://hetland.org



More information about the Digitalmars-d-learn mailing list