[Issue 6316] Class downcast is rejected in @safe code

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 14 06:51:32 PDT 2011


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


kennytm at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kennytm at gmail.com


--- Comment #1 from kennytm at gmail.com 2011-07-14 06:46:17 PDT ---
You should use std.conv.to, and then in Phobos the toImpl specialization

T toImpl(T, S)(S value)
    if (!isImplicitlyConvertible!(S, T) &&
        is(S : Object) && !is(typeof(value.opCast!T()) : T) &&
        is(T : Object) && !is(typeof(new T(value))))

should be made @trusted.

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