Don <> changed:

           What    |Removed                     |Added
           Keywords|                            |patch

--- Comment #1 from Don <> 2010-10-18 13:27:37 PDT ---
There are two independent issues here.
The superficial diagnostic bug is that mixin() shouldn't accept a void function
at all.
expression.c, line 5569. Actually the second error message here is optional,
since there
should have already been a "cannot be evaluated at compile time" error message.

Expression *CompileExp::semantic(Scope *sc)
    printf("CompileExp::semantic('%s')\n", toChars());
    e1 = resolveProperties(sc, e1);
+    if (!e1->type->isString()) {
+        error("argument to mixin must be a string, not (%s)\n",
+        return new ErrorExp();
+    }
    e1 = e1->optimize(WANTvalue | WANTinterpret);
    if (e1->op != TOKstring)
-    {    error("argument to mixin must be a string, not (%s)\n",
+    {   error("argument to mixin must be evaluated at compile time");
        return new ErrorExp();

The more important bug, which causes the ICE, is that declaration.c line 1212
is gagging the results.
Then, interpret.c runs semantic3 on the function while results are gagged.
The errors get suppressed, so garbage gets passed to the back end.

func.c, semantic3(), line 1592.

        sc2->callSuper = 0;
+    if (global.gag && global.errors)
+        semanticRun = PASSsemanticdone; // Ensure errors get reported again
+    else
    semanticRun = PASSsemantic3done;

void FuncDeclaration::toCBuffer(OutBuffer *buf, HdrGenState *hgs)

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

Reply via email to