www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11606] New: Cannot instantiate Tuple of non printable

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: monarchdodra gmail.com


--- Comment #0 from monarchdodra 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: -------
Nov 26 2013
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11606



--- Comment #1 from monarchdodra gmail.com 2013-11-26 13:38:10 PST ---
https://github.com/D-Programming-Language/phobos/pull/1723

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 26 2013
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11606


monarchdodra gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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