Other

D - Properties bug

// recls.d
public typedef int recls_bool_t;
class Entry
{
recls_bool_t IsReadOnly()
{
return Search_IsEntryReadOnly(m_entry);
}
// client code
if(entry.IsReadOnly) <== recls_test_2.d(197): recls_bool_t () does not
have a boolean value
{
whereas
// client code
if(entry.IsReadOnly())
{
works fine.
There are other circumstances in which the current properties implementation
is wanting. For example, in printf (and other vararg statements) they are
not "executed", and I presume the function address is put on the stack.
Since there can be no circumstances (at least I don't think so!) in which
the use of the property's value and the property's function's address is to
be taken, can we change the rule that any appearance of a property
function's name, without the (), is always invoked as the function. Taking
the address of the property's function could be done via &, or implicitly,
since the compiler should know that it's being assigned to, or passed as, a
delegate.