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
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
Filed it, with some small changes:
http://d.puremagic.com/issues/show_bug.cgi?id=3934
Bye,
bearophile
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!
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
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.
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()