www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Incorrect "delete aa[key] deprecated, use aa.remove(key)" error for linear array.

reply Jay <Jay_member pathlink.com> writes:
struct Box { int w, h, d; }
int main()
{
        Box*[10] boxes;
        boxes[0] = new Box;
        delete boxes[0];
        return 0;
}

The compiler mistakes the linear array in the above program for an
associative array, and exits with the following message:

bug.d:6: delete aa[key] deprecated, use aa.remove(key)
Jul 04 2005
next sibling parent "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"Jay" <Jay_member pathlink.com> wrote in message 
news:dacrtc$26ik$1 digitaldaemon.com...
 struct Box { int w, h, d; }
 int main()
 {
        Box*[10] boxes;
        boxes[0] = new Box;
        delete boxes[0];
        return 0;
 }

 The compiler mistakes the linear array in the above program for an
 associative array, and exits with the following message:

 bug.d:6: delete aa[key] deprecated, use aa.remove(key)
I think this is just in for a while, so that old code that uses the "delete" syntax for AAs can be updated to the new syntax. Though it would make sense if the compiler would only issue the deprecated error for AA types..
Jul 05 2005
prev sibling parent reply "Walter" <newshound digitalmars.com> writes:
"Jay" <Jay_member pathlink.com> wrote in message
news:dacrtc$26ik$1 digitaldaemon.com...
 The compiler mistakes the linear array in the above program for an
 associative array, and exits with the following message:

 bug.d:6: delete aa[key] deprecated, use aa.remove(key)
Are you using DMD 0.127? It works fine when I try it.
Jul 05 2005
parent reply Jay <Jay_member pathlink.com> writes:
Walter wrote:

 
 "Jay" <Jay_member pathlink.com> wrote in message
 news:dacrtc$26ik$1 digitaldaemon.com...
 The compiler mistakes the linear array in the above program for an
 associative array, and exits with the following message:

 bug.d:6: delete aa[key] deprecated, use aa.remove(key)
Are you using DMD 0.127? It works fine when I try it.
I was using gdc-0.14 which is indicated to be updated to DMD 0.127. I tested with DMD 0.127 and it works for me too. I apologize for the false alarm; I'll make sure to check against the latest DMD compiler before filing a report from now on.
Jul 05 2005
parent reply "Walter" <newshound digitalmars.com> writes:
"Jay" <Jay_member pathlink.com> wrote in message
news:dafkmd$1dg3$1 digitaldaemon.com...
 "Jay" <Jay_member pathlink.com> wrote in message
 news:dacrtc$26ik$1 digitaldaemon.com...
 The compiler mistakes the linear array in the above program for an
 associative array, and exits with the following message:

 bug.d:6: delete aa[key] deprecated, use aa.remove(key)
Are you using DMD 0.127? It works fine when I try it.
I was using gdc-0.14 which is indicated to be updated to DMD 0.127. I
tested
 with DMD 0.127 and it works for me too. I apologize for the false alarm;
 I'll make sure to check against the latest DMD compiler before filing a
 report from now on.
No problem, but may I suggest that if it's a GDC specific problem that there be a "GDC" in the subject? That'll also help David (who maintains GDC).
Jul 07 2005
parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Walter wrote:

 No problem, but may I suggest that if it's a GDC specific problem that there
 be a "GDC" in the subject? That'll also help David (who maintains GDC).
Or you can use the D.gnu newsgroup, where we discuss other GDC things ? Sometimes the GDC bugs also affect DMD (since they share the same front-end code), so posting them here might help both compilers... But do state your compiler (with version) and your platform (ditto) --anders
Jul 07 2005