[Issue 5747] cannot cast away shared if opCast defined

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Oct 7 08:29:47 PDT 2011


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


Jonathan M Davis <jmdavisProg at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
           Platform|Other                       |All
         Resolution|INVALID                     |
         OS/Version|Linux                       |All


--- Comment #3 from Jonathan M Davis <jmdavisProg at gmx.com> 2011-10-07 08:28:59 PDT ---
This is most definitely a dmd bug. Once you overload opCast, you can only cast
that type to the types that you've overloaded to cast to with opCast and the
_exact_ type that the variable already is. So, if it's S, you can cast to S but
not const S, shared S, or immutable S. If it's shared S, then you can cast to
shared S, but not S, shared S, or immutable S.

I don't know why you would think that this is not a dmd bug. Your original
example doesn't include BitArray at all.

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