digitalmars.D.bugs - Type inference bug: properties
- John C (6/6) Oct 26 2005 Type inference doesn't work on class properties.
- Carlos Santander (5/16) Oct 26 2005 Another case in favor (I think) to have a special syntax for properties,...
- Thomas Kuehne (10/16) Oct 28 2005 -----BEGIN PGP SIGNED MESSAGE-----
- John C (10/28) Oct 29 2005 An int. The correct syntax for a delegate would be:
Type inference doesn't work on class properties.
class TestClass {
int value() { return 5; }
}
TestClass c = new TestClass;
auto v = c.value; // changing this to 'auto v = c.value()' does work
Oct 26 2005
John C escribió:
Type inference doesn't work on class properties.
class TestClass {
int value() { return 5; }
}
TestClass c = new TestClass;
auto v = c.value; // changing this to 'auto v = c.value()' does work
Another case in favor (I think) to have a special syntax for properties,
instead
of what we currently have.
--
Carlos Santander Bernal
Oct 26 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
John C schrieb am 2005-10-26:
Type inference doesn't work on class properties.
class TestClass {
int value() { return 5; }
}
TestClass c = new TestClass;
auto v = c.value; // changing this to 'auto v = c.value()' does work
Should v be an int or a delegate?
Thomas
-----BEGIN PGP SIGNATURE-----
iD8DBQFDYfrX3w+/yD4P9tIRAl/tAKDBag2AXtGq1mDTOfDBWC5V7D+7bQCfYBsr
NPbBdSqyVN2vaDB8FRy99eA=
=lnHF
-----END PGP SIGNATURE-----
Oct 28 2005
"Thomas Kuehne" <thomas-dloop kuehne.cn> wrote in message news:nfa933-vh6.ln1 eiche.kuehne.cn...-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 John C schrieb am 2005-10-26:An int. The correct syntax for a delegate would be: auto v = &c.value as this test shows: auto v1 = c.value(); auto v2 = &c.value; writefln("type = " ~ typeid(typeof(v1)).toString()); // type = int writefln("type = " ~ typeid(typeof(v2)).toString()); // type = int delegate()Type inference doesn't work on class properties. class TestClass { int value() { return 5; } } TestClass c = new TestClass; auto v = c.value; // changing this to 'auto v = c.value()' does workShould v be an int or a delegate?Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFDYfrX3w+/yD4P9tIRAl/tAKDBag2AXtGq1mDTOfDBWC5V7D+7bQCfYBsr NPbBdSqyVN2vaDB8FRy99eA= =lnHF -----END PGP SIGNATURE-----
Oct 29 2005









Carlos Santander <csantander619 gmail.com> 