[Issue 11591] New: `const`/`immutable` `std.typecons.Tuple`-s with classes fails at runtime as associative array keys

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


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

           Summary: `const`/`immutable` `std.typecons.Tuple`-s with
                    classes fails at runtime as associative array keys
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: regression
          Priority: P2
         Component: Phobos
        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:46:59 MSK ---
At least a year ago `const`/`immutable` `std.typecons.Tuple`-s with classes
worked as associative array keys. The fact it fails at runtime now is rather
nasty. It should either work or fail to compile.

---
import std.typecons;

void main()
{
    alias T = Tuple!Object;
    int[const T] aa; // No CT errors
    aa[T()] = 1;
    aa[T()] = 1; // Error at runtime
}
---
object.Error: TypeInfo.compare is not implemented
---

E.g. fixing Issue 11590 will fix this issue by rejecting such associative
arrays to compile unless Issue 1824 is fixed.

-- 
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