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


Don <clugd...@yahoo.com.au> changed:

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


--- Comment #10 from Don <clugd...@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: -------

Reply via email to