www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - auto bug

reply Tommy <Tommy_member pathlink.com> writes:
This works:

int main(char[][] args) {
auto var = 3.14159;
printf("Hello world!");
printf("%f", var);
return 0;
}

but this makes the compiler hang:

auto var = 3.14159;

int main(char[][] args) {
printf("Hello world!");
printf("%f", var);
return 0;
}

Best regards,
Tommy
Oct 29 2005
parent Derek Parnell <derek psych.ward> writes:
On Sat, 29 Oct 2005 09:39:07 +0000 (UTC), Tommy wrote:

 This works:
 
 int main(char[][] args) {
 auto var = 3.14159;
 printf("Hello world!");
 printf("%f", var);
 return 0;
 }
 
 but this makes the compiler hang:
 
 auto var = 3.14159;
 
 int main(char[][] args) {
 printf("Hello world!");
 printf("%f", var);
 return 0;
 }
 
 Best regards,
 Tommy
I reported this a few days ago. Walter says that 'auto' was not intended to be used at the module level, but he'll consider doing something about that. That could mean he'll flag it as an error or he'll allow it - I'm not sure which. -- Derek Parnell Melbourne, Australia 29/10/2005 9:46:11 PM
Oct 29 2005