[Issue 7660] New: toImpl conflict in std.conv

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 7 10:38:39 PST 2012


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 at puremagic.com
        ReportedBy: admin at dav1d.de


--- Comment #0 from David <admin at dav1d.de> 2012-03-07 10:38:41 PST ---
/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: -------


More information about the Digitalmars-d-bugs mailing list