http://d.puremagic.com/issues/show_bug.cgi?id=2551

           Summary: std.format on invariant values : error and segmentation
                    fault
           Product: D
           Version: 2.022
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: bugzi...@digitalmars.com
        ReportedBy: dran...@free.fr


import std.stdio;

class Foo {
    double x;
    this(double x) { this.x = x; }
}

void main() {
    auto ifoo = new invariant(Foo)(0.);
    auto foo = new Foo(0.);
    writeln(foo.x);
    writeln(ifoo.x); // <- Error
}

causes this compiler output :

/usr/local/bin/../src/phobos/std/format.d(2048): Error: no property 'toString'
for type 'invariant(double)'
/usr/local/bin/../src/phobos/std/format.d(2049): template
std.stdio.PrivateFileWriter!(char).PrivateFileWriter.write(C) does not match
any function template declaration
/usr/local/bin/../src/phobos/std/format.d(2049): template
std.stdio.PrivateFileWriter!(char).PrivateFileWriter.write(C) cannot deduce
template function from argument types !()(int)
Segmentation fault


-- 

Reply via email to