[Issue 7628] Regression with std.string format and alias this

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Mar 2 06:22:10 PST 2012


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



--- Comment #2 from Kenji Hara <k.hara.pg at gmail.com> 2012-03-02 06:22:09 PST ---
Don't link to an external site, because it may be disappear in the future.
Instead write code directly, or attach the testcase, please.

> http://ideone.com/iSBBO 

import std.string;
import std.stdio;

struct S {
    ubyte[] metadata;

    string toString(){
        return "%s".format( metadata );
    }
}

struct Foo {
    S[] bar;
    alias bar this;

    string toString(){
        return "%s".format( bar );
    }
}

void main(){
    S   s;
    s.metadata = [0,1,2];
    Foo foo;
    foo.bar = [s];

    writeln( foo );
}

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


More information about the Digitalmars-d-bugs mailing list