digitalmars.D - Re: Behavior of "auto"
- bearophile <bearophileHUGS lycos.com> Dec 07 2007
- Sean Kelly <sean f4.ca> Dec 07 2007
Sean Kelly:I'd guess that this is a bug, and is related to the extra work the compiler does for foreach loops.
This is a reduced and simplified version that shows the same thing: class Foo { ~this() { printf("Destroyed\n"); } } void main() { foreach(i; new int[1]) scope Foo f = new Foo(); } Bye, bearophile
Dec 07 2007
bearophile wrote:Sean Kelly:I'd guess that this is a bug, and is related to the extra work the compiler does for foreach loops.
This is a reduced and simplified version that shows the same thing: class Foo { ~this() { printf("Destroyed\n"); } } void main() { foreach(i; new int[1]) scope Foo f = new Foo(); }
Please submit a ticket for it if you haven't already :-) Sean
Dec 07 2007