www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Properties requiring () in some cases

reply "Vathix" <vathixSpamFix dprogramming.com> writes:
class Foo
{
   static bit prop() { return false; }
}

int main()
{
   if(1 && Foo.prop) { } // bit() does not have a boolean value
   switch(Foo.prop) { } // 'prop' is not an integral type

   return 0;
}


The first 2 statements in main() only work if Foo.prop() is used. I think it
thinks it's a function address like old times.
Jul 08 2004
next sibling parent "Vathix" <vathixSpamFix dprogramming.com> writes:
Also:


class Foo
{
   static char[] charprop() { return null; }
}

int main()
{
   foreach(char ch; Foo.charprop) { } // foreach: char[]() is not an
aggregate type

   return 0;
}
Jul 08 2004
prev sibling parent reply "Vathix" <vathixSpamFix dprogramming.com> writes:
In constructor parameters, too..
Jul 20 2004
parent "Walter" <newshound digitalmars.com> writes:
These are now taken care of. Thanks, -Walter
Dec 29 2004