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


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

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


--- Comment #4 from Don <clugd...@yahoo.com.au> 2010-09-06 14:01:17 PDT ---
This turns out to be simple. When there's an error in the AA parameters, it
should not continue to instantiate the template.
There's no "error declaration", so return a struct of type TError. Not sure if
it's OK to give it no name.
(Would also be possible to return NULL in this case, but then everything that
calls it would need to be changed, to prevent segfaults).

PATCH(mtype.c): Line 3966

StructDeclaration *TypeAArray::getImpl()
{
    // Do it lazily
    if (!impl)
    {
        Type *index = this->index;
        Type *next = this->next;
        if (index->reliesOnTident() || next->reliesOnTident())
        {
            error(loc, "cannot create associative array %s", toChars());
            index = terror;
            next = terror;
+            StructDeclaration *s = new StructDeclaration(0, NULL);
+            s->type = terror;
+            return s;
        }

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

Reply via email to