[Issue 8186] New: Formatting class object has an alias this to int* field is broken.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jun 2 02:57:26 PDT 2012


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

           Summary: Formatting class object has an alias this to int*
                    field is broken.
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2012-06-02 02:59:18 PDT ---
>From github:
https://github.com/D-Programming-Language/phobos/pull/575#issuecomment-6075942

import std.stdio;
class B
{
  int*a;
  this(){ a = new int; }
  alias a this;
}
void main(){ writeln(B.init); }

dmd/phobos/std/format.d(2577): Error: template std.format.formatValue matches
more than one template declaration,
dmd/phobos/std/format.d(2151):formatValue(Writer,T,Char) if (is(T == class) &&
!is(T == enum)) and dmd/phobos/std/format.d(2476):formatValue(Writer,T,Char) if
(isPointer!(T))

-- 
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