Bug 4723 – Bugs with Associative Arrays .init: Integer Divide by Zero / incompatible types

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-08-25T06:00:00Z
Last change time
2011-08-04T02:18:38Z
Assigned to
nobody
Creator
zan77137
Depends on
3962

Comments

Comment #0 by zan77137 — 2010-08-25T06:00:00Z
This code doesn't work: void main() { int[int] a = (int[int]).init; a[1] = 2; } This makes runtime error: object.Error: Integer Divide by Zero And this: void main() { int[int] a = (int[int]).init; a[1] = 2; } This makes compiletime error: Error: incompatible types for ((a) == (AssociativeArray(null))): 'int[int]' and 'AssociativeArray!(int,int)' These bug probably depends on this: http://d.puremagic.com/issues/show_bug.cgi?id=3962
Comment #1 by zan77137 — 2010-08-25T06:06:48Z
Sorry, I missed. Correctly for #2: void main() { int[int] a; assert(a == a.init); } Error: incompatible types for ((a) == (AssociativeArray(null))): 'int[int]' and 'AssociativeArray!(int,int)'
Comment #2 by code — 2011-08-04T02:18:38Z
*** This issue has been marked as a duplicate of issue 6433 ***