[Issue 11606] New: Cannot instantiate Tuple of non printable

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 26 01:59:39 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=11606

           Summary: Cannot instantiate Tuple of non printable
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: monarchdodra at gmail.com


--- Comment #0 from monarchdodra at gmail.com 2013-11-26 01:59:38 PST ---
//----
import std.typecons;

class Foo{}

void main()
{
  Tuple!(immutable(Foo)) a;
}
//----
src\phobos\std\format.d(2619): Error: template instance
formatObject!(Appender!string, immutable(Foo), char) does not match template
declaration formatObject(Writer, T, Char)(ref Writer w, ref T val, ref
FormatSpec!Char f) if (hasToString!(T, Char))
src\phobos\std\format.d(2382): Error: template instance
std.format.formatValue!(Appender!string, immutable(Foo), char) error
instantiating
src\phobos\std\typecons.d(570):        instantiated from here:
formatElement!(Appender!string, immutable(Foo), char)
//----

This is problematic, in the sense that we never even made a call to print. We
just declared the tuple.

Root issue:
https://d.puremagic.com/issues/show_bug.cgi?id=11605

Workaround:
Make toString() implementation conditional:
https://github.com/D-Programming-Language/phobos/pull/1724

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list