[Issue 5555] Built-in associative arrays in pure nothrow functions

2012-12-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=


lt.infiltra...@gmail.com changed:

   What|Removed |Added

 CC||lt.infiltra...@gmail.com


--- Comment #4 from lt.infiltra...@gmail.com 2012-12-18 17:13:09 PST ---
*** Issue 9168 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 5555] Built-in associative arrays in pure nothrow functions

2012-07-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=


Witold Baryluk bary...@smp.if.uj.edu.pl changed:

   What|Removed |Added

 CC||bary...@smp.if.uj.edu.pl


--- Comment #3 from Witold Baryluk bary...@smp.if.uj.edu.pl 2012-07-05 
11:25:55 PDT ---
Any updates? I'm trying to implement toHash() method which needs to be nothrow,
and inside it I use aa.byKey or aa.keys or foreach (...; aa). Currently I
cannot without some hacks. Fixes in rt.* should be relatively easy for most of
this functions.

Regards,
Witek

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 5555] Built-in associative arrays in pure nothrow functions

2011-09-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=


bearophile_h...@eml.cc changed:

   What|Removed |Added

Summary|built-in associative|Built-in associative arrays
   |array's length is not   |in pure nothrow functions
   |nothrow |


--- Comment #2 from bearophile_h...@eml.cc 2011-09-18 11:39:35 PDT ---
Currently associative arrays can't be used much in pure nothrow functions:

void main() pure nothrow {
int[int] aa;
aa.rehash;
auto L = aa.length;
auto x = aa.get(0, 10);
auto k = aa.keys;
auto v = aa.values;
auto bk = aa.byKey();
auto bv = aa.byValue();
}


DMD 2.055 gives:

test.d(3): Error: pure function 'main' cannot call impure function 'rehash'
test.d(4): Error: pure function 'main' cannot call impure function 'length'
test.d(5): Error: pure function 'main' cannot call impure function 'get'
test.d(6): Error: pure function 'main' cannot call impure function 'keys'
test.d(7): Error: pure function 'main' cannot call impure function 'values'
test.d(8): Error: pure function 'main' cannot call impure function 'byKey'
test.d(9): Error: pure function 'main' cannot call impure function 'byValue'
test.d(3): Error: aa.rehash is not nothrow
test.d(4): Error: aa.length is not nothrow
test.d(5): Error: aa.get is not nothrow
test.d(6): Error: aa.keys is not nothrow
test.d(7): Error: aa.values is not nothrow
test.d(8): Error: aa.byKey is not nothrow
test.d(9): Error: aa.byValue is not nothrow
test.d(1): Error: function D main 'main' is nothrow yet may throw

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---