Thread overview
[Issue 510] New: Nonworking implicit conversions between arrays and pointers
Nov 15, 2006
d-bugmail
Dec 03, 2006
d-bugmail
Dec 12, 2006
d-bugmail
November 15, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=510

           Summary: Nonworking implicit conversions between arrays and
                    pointers
           Product: D
           Version: 0.174
          Platform: PC
               URL: http://www.digitalmars.com/d/arrays.html
        OS/Version: Windows
            Status: NEW
          Keywords: spec
          Severity: normal
          Priority: P4
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: deewiant@gmail.com


The comments should explain it:

class U {}
class T : U {}

void main() {
        T*   ptr;
        T[2] sar;
        T[]  dar;

        // all of the following should work according to the "Implicit
Conversions" section of the spec

        tPtr(ptr); tPtr(sar); tPtr(dar);
        tDar(sar);
        uPtr(ptr); uPtr(sar); uPtr(dar); // none of these work
        uSar(sar);                       // doesn't work
        uDar(sar); uDar(dar);            // the first of these doesn't work
        vPtr(ptr); vPtr(sar); vPtr(dar);
        vDar(sar); vDar(dar);            // the latter of these two works, but
isn't mentioned in the spec
}

void tPtr(T*t){}
void tDar(T[]t){}
void uPtr(U*u){}
void uSar(U[2]u){}
void uDar(U[]u){}
void vPtr(void*v){}
void vDar(void[]v){}


-- 

December 03, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=510





------- Comment #1 from deewiant@gmail.com  2006-12-03 03:48 -------
Spec partially corrected for DMD 0.176.

The "uDar(dar)" case still isn't mentioned in the spec.


-- 

December 12, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=510


bugzilla@digitalmars.com changed:

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




------- Comment #2 from bugzilla@digitalmars.com  2006-12-12 04:14 -------
Fixed DMD 0.176


--