Thread overview
[Issue 7598] New: format() doesn't work with alias this
Feb 27, 2012
Andrej Mitrovic
Apr 20, 2012
SomeDude
Apr 20, 2012
Kenji Hara
Apr 24, 2012
Kenji Hara
February 27, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7598

           Summary: format() doesn't work with alias this
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody@puremagic.com
        ReportedBy: andrej.mitrovich@gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2012-02-26 18:23:19 PST ---
import std.stdio;
import std.string;

struct Wrap
{
    string a;
    alias a this;
}

struct Foo
{
    Wrap wrap;
    string toString() { return format("%s", wrap); }
}

void main()
{
    Foo foo;
    writeln(foo);
}

std.format.FormatException@std\format.d(4400): Can't convert test.Wrap to
string: "string toString()" not defined

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 20, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7598


SomeDude <lovelydear@mailmetrash.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lovelydear@mailmetrash.com


--- Comment #1 from SomeDude <lovelydear@mailmetrash.com> 2012-04-20 02:18:41 PDT ---
See also issue 7922

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 20, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7598



--- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> 2012-04-20 02:30:27 PDT ---
(In reply to comment #1)
> See also issue 7922

No, this is std.string.format function problem, then it is Phobos issue. And 7922 is a dmd issue. So they are not related.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 24, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7598


Kenji Hara <k.hara.pg@gmail.com> changed:

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


--- Comment #3 from Kenji Hara <k.hara.pg@gmail.com> 2012-04-24 04:59:22 PDT ---
*** This issue has been marked as a duplicate of issue 6595 ***

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