| Thread overview | |||||
|---|---|---|---|---|---|
|
June 27, 2006 Bug? array concatenation/appand | ||||
|---|---|---|---|---|
| ||||
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.
| ||||
June 27, 2006 Re: Bug? array concatenation/appand | ||||
|---|---|---|---|---|
| ||||
Posted in reply to icee | "icee" <iceelyne@gmail.com> wrote in message news:e7q4o7$7sk$1@digitaldaemon.com... > Is this a bug or I'd made some mistakes. All internal errors are bugs. | |||
June 27, 2006 Re: Bug? array concatenation/appand | ||||
|---|---|---|---|---|
| ||||
Posted in reply to icee | In article <e7q4o7$7sk$1@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 ? | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply