[dmd-beta] D 2.062 beta

Nick Sabalausky bus_dmdbeta at semitwist.com
Sat Feb 9 14:52:40 PST 2013


On Sat, 9 Feb 2013 18:03:53 +0900
kenji hara <k.hara.pg at gmail.com> wrote:

> 2013/2/9 Nick Sabalausky <bus_dmdbeta at semitwist.com>
> 
> > On Fri, 8 Feb 2013 18:25:27 -0500
> > Nick Sabalausky <bus_dmdbeta at semitwist.com> wrote:
> > One of the problems turned out to be the following, which I'm
> > guessing is probably intentional?:
> >
> >     import std.stdio;
> >
> >     struct Foo
> >     {
> >         string toString()
> >         {
> >             return "hello";
> >         }
> >     }
> >
> >     void main()
> >     {
> >         const f = Foo();
> >
> >         // In 2.061 and up, this outputs "const(Foo)()"
> >         // instead of "hellO". A fixed bug?
> >         writeln(f);
> >     }
> >
> 
> This behavior (formatting const Foo object by writeln) is at least
> from 2.058.
> 
> The result of const Foo object formatting by std.string.format is
> changed from 2.061, to make it consistent with the result by writeln.
> 

Ok, my original code *is* using format which is why it didn't break
until 2.061. I ended up changing it to writefln only for the minimized
test case above. Didn't realize there was a difference.


More information about the dmd-beta mailing list