[Issue 9498] Rang violation using AA
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Feb 12 11:49:34 PST 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9498
Maxim Fomin <maxim at maxim-fomin.ru> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |maxim at maxim-fomin.ru
--- Comment #1 from Maxim Fomin <maxim at maxim-fomin.ru> 2013-02-12 11:49:32 PST ---
This is neither a bug nor a regression.
An element is accessed in return statement, which makes it an rvalue, so
allocation if absence does not applies here.
It works as clarified in TDPL. From TDPL (p. 115):
"To read a value off an associative array given a key, just read aa [ key] .
(The compiler distinguishes reads from writes and invokes slightly different
functions.)" - it is implemented in druntime as aaGetValueX and aaGetRvalueX or
something like that.
Further:
"If you try to read the value for a key not found in the associative array, a
range violation exception is thrown."
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list