[Issue 11590] New: [AA] Associative arrays should reject uncomparable types

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Nov 24 00:27:30 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=11590

           Summary: [AA] Associative arrays should reject uncomparable
                    types
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: verylonglogin.reg at gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin.reg at gmail.com> 2013-11-24 12:27:29 MSK ---
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.

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


More information about the Digitalmars-d-bugs mailing list