Cryptic Error message with scope(failure) and AA

2013-06-29 Thread Anthony Goins
Is this known? I've heard there are many problems with associative arrays. dmd 2.063 --- module scopefailtest; int[char] AAarray; void main(string[] args) { AAarray = ['a':1, 'b':2, 'c':3]; foreach(aa; AAarray) { scope(failure)continue; aa = 32; } } ---

Re: Cryptic Error message with scope(failure) and AA

2013-06-29 Thread monarch_dodra
On Saturday, 29 June 2013 at 20:45:12 UTC, Anthony Goins wrote: Is this known? I've heard there are many problems with associative arrays. dmd 2.063 --- module scopefailtest; int[char] AAarray; void main(string[] args) { AAarray = ['a':1, 'b':2, 'c':3]; foreach(aa; AAarray) {

Re: Cryptic Error message with scope(failure) and AA

2013-06-29 Thread Jonathan M Davis
On Saturday, June 29, 2013 23:26:33 monarch_dodra wrote: > Which is wrong, since a scope(failure) is not supposed to "catch" > the exception. In this case, the "continue" short-circuits the > compiler generated "rethrow". I thought that there was a bug report on that (probably suggesting that the

Re: Cryptic Error message with scope(failure) and AA

2013-06-29 Thread bearophile
Jonathan M Davis: I thought that there was a bug report on that (probably suggesting that the compiler make such a continue illegal), but I can't find it right now. If you can't find it, it's better to file it because it's better to have a bug two times in Bugzilla than no times. Bye, bear

Re: Cryptic Error message with scope(failure) and AA

2013-06-29 Thread Ali Çehreli
On 06/29/2013 02:26 PM, monarch_dodra wrote: DMD is on to something, because if you replace failure with "exit" or "success", then it complains with: "Error: continue is not inside a loop". Hmmm... 'continue' and others are disallowed only for scope(exit) and scope(success): http://dlang.

Re: Cryptic Error message with scope(failure) and AA

2013-06-29 Thread Anthony Goins
Seems like there are several levels of "wrong" actually: What do you expect "scope(failure)continue" to do exactly? I was reading an array of files (Document[string]). Stuck the scope(failure)continue in late at night apparently to skip reading files that no longer exist. Forgot about it