digitalmars.D.bugs - with (pointer to struct)
- Carlos Santander B. (18/18) Apr 09 2005 I think this is a bug:
- Thomas Kuehne (11/25) Apr 10 2005 -----BEGIN PGP SIGNED MESSAGE-----
- Carlos Santander B. (5/41) Apr 11 2005 --
I think this is a bug:
//------------------------
struct foo {}
void main()
{
foo f1;
foo *f2;
with (f1) {} // works
with (*f2) {} // works
with (f2) {} // doesn't work
}
//------------------------
dmd test.d
test.d(9): with expressions must be class objects, not 'foo *'
DMD 0.120, Windows. Haven't tried linux.
--
Carlos Santander Bernal
JP2, you'll always live in our minds
Apr 09 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Carlos Santander B. schrieb am Sat, 09 Apr 2005 10:47:49 -0500:
I think this is a bug:
//------------------------
struct foo {}
void main()
{
foo f1;
foo *f2;
with (f1) {} // [A] works
with (*f2) {} // [B] works
with (f2) {} // [C] doesn't work
}
//------------------------
dmd test.d
test.d(9): with expressions must be class objects, not 'foo *'
In A and B you pass a struct, in C you pass a pointer to a struct.
The error message about "class objects" is missleading.
Thomas
-----BEGIN PGP SIGNATURE-----
iD8DBQFCWfRI3w+/yD4P9tIRAnglAJ9XTwlvmLfORmNWAP1SvVvGL6Ol4ACfa15p
bFihVej0BDoni+piwhKgvtM=
=tNlX
-----END PGP SIGNATURE-----
Apr 10 2005
Thomas Kuehne wrote:-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Carlos Santander B. schrieb am Sat, 09 Apr 2005 10:47:49 -0500:I know that, but I still expect C to work.I think this is a bug: //------------------------ struct foo {} void main() { foo f1; foo *f2; with (f1) {} // [A] works with (*f2) {} // [B] works with (f2) {} // [C] doesn't work } //------------------------ dmd test.d test.d(9): with expressions must be class objects, not 'foo *'In A and B you pass a struct, in C you pass a pointer to a struct. The error message about "class objects" is missleading.Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCWfRI3w+/yD4P9tIRAnglAJ9XTwlvmLfORmNWAP1SvVvGL6Ol4ACfa15p bFihVej0BDoni+piwhKgvtM= =tNlX -----END PGP SIGNATURE------- Carlos Santander Bernal JP2, you'll always live in our minds
Apr 11 2005








"Carlos Santander B." <csantander619 gmail.com>