[Issue 3336] ICE(glue.c) declaring AA with tuple key, only with -g

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Sep 24 00:45:33 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3336


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


--- Comment #10 from Don <clugdbug at yahoo.com.au> 2009-09-24 00:45:31 PDT ---
PATCH: This is very easy. Just disallow tuples as AA keys.

In mtype.c, in Type *TypeAArray::semantic(Loc loc, Scope *sc), at line 3293:

    switch (index->toBasetype()->ty)
    {
    case Tbool:
    case Tfunction:
    case Tvoid:
    case Tnone:
+    case Ttuple:
        error(loc, "can't have associative array key of %s",
index->toBasetype()->toChars());
        break;
    }


And here's a test case for the test suite. Should compile without error.
---
template Tuple(T...){
    alias T Tuple;
}
// Bugzilla 3336
static assert(!is(int[ Tuple!(int, int) ]));

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


More information about the Digitalmars-d-bugs mailing list