www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7660] New: toImpl conflict in std.conv

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7660

           Summary: toImpl conflict in std.conv
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: admin dav1d.de



/usr/include/d/std/conv.d(244): Error: template std.conv.toImpl(T,S) if
(isImplicitlyConvertible!(S,T)) toImpl(T,S) if (isImplicitlyConvertible!(S,T))
matches more than one template declaration,
/usr/include/d/std/conv.d(932):toImpl(T,S) if (is(S : Object) &&
isSomeString!(T)) and /usr/include/d/std/conv.d(965):toImpl(T,S) if (is(S ==
struct) && is(typeof(&S.init.toString)) && isSomeString!(T))


-----
import std.conv : to;


class Bar {}

struct Foo {
    Bar bar;
    alias bar this;

    static Foo c() {
        Foo ret;
        ret.bar = new Bar();
        return ret;
    }
}

void main() {
    Foo foo = Foo.c();

    to!string(foo);
}
-----

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 07 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7660




https://github.com/D-Programming-Language/phobos/pull/482

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 07 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7660




Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/30d9405ad48cbaef934af897e85ff8514a33e579
added tests for bug 7660

https://github.com/D-Programming-Language/phobos/commit/803aa7ccb04dae273169b70fbff4ecdcd2ada884


Bug 7660, incorrect toImpl overload for struct with alias this to class

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 20 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7660


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

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


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