March 01, 2005 struct and === Internal error: ..\ztc\cgcs.c 353 | ||||
---|---|---|---|---|
| ||||
struct foo { int opEquals(foo x) { return this.normalize === x.normalize; } foo normalize() { foo res; return res; } } int main() { return 0; } The above example produces on windows dmd-0.114: Internal error: ..\ztc\cgcs.c 353 It compiles if instead of using the normalize function the body of opEquals is return *this === x; so it looks like the return values from the functions are confusing the === operator. It doesn't matter if foo has any data members. |
March 12, 2005 Re: struct and === Internal error: ..\ztc\cgcs.c 353 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ben Hinkle Attachments: | Ben Hinkle wrote: | struct foo { | int opEquals(foo x) { | return this.normalize === x.normalize; | } | foo normalize() { | foo res; | return res; | } | } | int main() { | return 0; | } | | The above example produces on windows dmd-0.114: | | Internal error: ..\ztc\cgcs.c 353 | | It compiles if instead of using the normalize function the body of | opEquals is | return *this === x; | so it looks like the return values from the functions are confusing | the === operator. It doesn't matter if foo has any data members. Added to DStress as http://dstress.kuehne.cn/run/bug_cgcs_353_C.d Thomas |
Copyright © 1999-2021 by the D Language Foundation