Bug 19262 – hashOf associative array should infer nothrow

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-09-24T19:51:28Z
Last change time
2018-10-07T05:25:33Z
Assigned to
No Owner
Creator
Nathan S.

Comments

Comment #0 by n8sh.secondary — 2018-09-24T19:51:28Z
The following code doesn't compile: --- void main() nothrow { int[int] aa; auto h = .hashOf(aa); } --- The underlying issue is that `_aaApply2` (used in `foreach` over an associative array) is not able to infer `nothrow`, but it will probably be easier to use a workaround than to address that.
Comment #1 by n8sh.secondary — 2018-10-06T15:54:33Z
Comment #2 by github-bugzilla — 2018-10-07T05:25:32Z
Commits pushed to master at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/050ad81f24e1543f409cc0280e9f5d0c81193eea Fix Issue 19262 - hashOf associative array should infer nothrow https://github.com/dlang/druntime/commit/f60615f47acd84786c0866a4688e2bdbaf5e7815 Merge pull request #2323 from n8sh/issue-19262 Fix Issue 19262 - hashOf associative array should infer nothrow merged-on-behalf-of: Nathan Sashihara <[email protected]>