Thread overview
Incorrect "delete aa[key] deprecated, use aa.remove(key)" error for linear array.
Jul 05, 2005
Jay
Jul 05, 2005
Walter
Jul 06, 2005
Jay
Jul 07, 2005
Walter
July 05, 2005
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)
July 05, 2005
"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..


July 05, 2005
"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.


July 06, 2005
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.
July 07, 2005
"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).


July 07, 2005
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