Don <> changed:

           What    |Removed                     |Added
           Keywords|                            |patch

--- Comment #3 from Don <> 2010-01-10 14:11:14 PST ---
Janice's first case has compiled for quite a long time now. The third case,
involving 'new', is very straightforward.  The final case (changing length) is
doubtful whether it is a good idea. I think with implementing 'new', we can
close this bug.

PATCH to allow dynamic array creation with new. Insert this code into
interpret.c, around line 2690. Also add the declaration for it in NewExp in
expression.h. Also need to change the spec to remove the restriction on using

Expression *NewExp::interpret(InterState *istate)
#if LOG
    printf("NewExp::interpret() %s\n", toChars());
    if (newtype->ty == Tarray && arguments && arguments->dim == 1)
    Expression *lenExpr = ((Expression
    if (lenExpr == EXP_CANT_INTERPRET)
        return EXP_CANT_INTERPRET;
    return createBlockDuplicatedArrayLiteral(newtype,
        newtype->defaultInitLiteral(), lenExpr->toInteger());
    error("Cannot interpret %s at compile time", toChars());

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to