Bug? array concatenation/appand

Rémy Mouëza ray.jay.ay.moueza at DoNtSpAm.gmail.com
Tue Jun 27 11:11:40 PDT 2006


In article <e7q4o7$7sk$1 at digitaldaemon.com>, icee says...
>
>struct SPoint{
>double x,y;
>SPoint create(double x,double y){
>SPoint p;
>p.x=x;
>p.y=y;
>return p;
>}
>}
>..
>SPoint[] sps;
>sps~=SPoint.create(2,4);//OK.
>
>sps=sps~SPoint.create(2,4);//Internal error: ..\ztc\type.c 308, dmd v0.161
>
>int[] a;
>a~=2;//OK.
>a=a~2;//OK.
>
>Is this a bug or I'd made some mistakes.
>

It seems that you are calling a non static function in a static context. The
compiler should have detected this. Have you tried to put a static qualifier to
the Spoint.create member function ?





More information about the Digitalmars-d mailing list