Summary: No template instantiation backtrace printed trying to
                    use writefln on a const or immutable object reference
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Stewart Gordon <> 2012-03-24 17:52:11 PDT ---
DMD 2.058, Win32
import std.stdio;

class Set(Element) {
    void show(Element e) {
        writefln("%s", e);

void main() {
    Set!(const(Object)) set2;
C:\Users\Stewart\Documents\Programming\D\Tests\bugs>dmd hashset1.d
d:\dmd2\windows\bin\..\..\src\phobos\std\format.d(1858): Error: template
instance formatObject!(LockingTextWriter,const(Object),char)
formatObject!(LockingTextWriter,const(Object),char) does not match template
declaration formatObject(Writer,T,Char) if (hasToString!(T,Char))

main instantiates Set
Set instantiates writefln
writefln instantiates File.writefln
File.writefln instantiates formatGeneric
formatGeneric instantiates formatValue
formatValue tries to instantiates formatObject but fails

Despite this chain of template instantiations, no backtrace is printed. 
Consequently, it took me ages to find what in my code was triggering it in
order to produce this reduced testcase.

Fixing issue 1824 will invalidate this testcase, but won't fix the underyling
compiler bug, which could potentially bite in other ways.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to