Bug 11590 – [AA] Associative arrays should reject uncomparable types

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-11-24T00:27:00Z
Last change time
2014-01-01T15:16:36Z
Keywords
accepts-invalid
Assigned to
nobody
Creator
verylonglogin.reg

Comments

Comment #0 by verylonglogin.reg — 2013-11-24T00:27:29Z
Currently associative arrays accepts uncomparable types and fails only at runtime: --- struct S { void opCmp() { } } void main() { int[const S] aa; // Must be a compilation error aa[S.init] = 1; aa[S.init] = 1; // Error at runtime } --- object.Error: TypeInfo.compare is not implemented --- Also see Issue 11589.
Comment #1 by bugzilla — 2014-01-01T02:46:07Z
*** This issue has been marked as a duplicate of issue 11591 ***
Comment #2 by verylonglogin.reg — 2014-01-01T06:33:14Z
(In reply to comment #1) > *** This issue has been marked as a duplicate of issue 11591 *** IMO a dmd bug can't be a duplicate of Phobos regression. The fact that fixing dmd bug will resolve the regression can't be used this way. Also it's clearly noted in the regression description fixing this dmd bug will resolve it.
Comment #3 by bugzilla — 2014-01-01T15:16:36Z
11591 was fixed by fixing the compiler, and it's the same issue as this bug report.