Re: Tidy attributes

2010-03-15 Thread Don
Ary Borenszweig wrote: bearophile wrote: While looking for possible attribute problems to add to Bugzilla, I have seen the following D2 program compiles and runs with no errors or warnings: static foo1() {} final foo2() {} ref foo3() {} enum void foo5() {} nothrow foo4() {} pure foo6() {} st

Re: Tidy attributes

2010-03-12 Thread Ary Borenszweig
bearophile wrote: While looking for possible attribute problems to add to Bugzilla, I have seen the following D2 program compiles and runs with no errors or warnings: static foo1() {} final foo2() {} ref foo3() {} enum void foo5() {} nothrow foo4() {} pure foo6() {} static int x1 = 10; static

Re: Tidy attributes

2010-03-11 Thread bearophile
Filed it, with some small changes: http://d.puremagic.com/issues/show_bug.cgi?id=3934 Bye, bearophile

Re: Tidy attributes

2010-03-11 Thread Pelle Månsson
On 03/11/2010 10:44 PM, bearophile wrote: As far as I know, it's "enum" that has that purpose. Oh, but they are not the same. enum declares a constant, whereas static declares a variable. A static global is still mutable. Thank you for your answers, bearophile Why thank you!

Re: Tidy attributes

2010-03-11 Thread bearophile
Pelle M. > static does not apply to free functions, I would guess this means the > same as auto. As far as I know a global function like: auto foo() {} is correct in D2, it means the compiler will infer the return type, that here is void. That's why I have not added this case to that list. >s

Re: Tidy attributes

2010-03-11 Thread Pelle Månsson
On 03/11/2010 10:20 PM, bearophile wrote: While looking for possible attribute problems to add to Bugzilla, I have seen the following D2 program compiles and runs with no errors or warnings: static foo1() {} static does not apply to free functions, I would guess this means the same as auto.

Tidy attributes

2010-03-11 Thread bearophile
While looking for possible attribute problems to add to Bugzilla, I have seen the following D2 program compiles and runs with no errors or warnings: static foo1() {} final foo2() {} ref foo3() {} enum void foo5() {} nothrow foo4() {} pure foo6() {} static int x1 = 10; static x2 = 10; void main()