diff --git a/dmd2/cast.c b/dmd2/cast.c index 64dfb1df..4744ea74 100644 --- a/dmd2/cast.c +++ b/dmd2/cast.c @@ -1804,7 +1804,6 @@ Expression *CommaExp::castTo(Scope *sc, Type *t) /**************************************** * Set type inference target * flag 1: don't put an error when inference fails - * 2: ldc specific: allow to infer function literal kind (TOKdelegate or TOKfunction) */ Expression *Expression::inferType(Type *t, int flag, TemplateParameters *tparams) @@ -1965,27 +1964,9 @@ Expression *FuncExp::inferType(Type *to, int flag, TemplateParameters *tparams) } else e = this; - -#if IN_LLVM - if (flag == 2 && e) - { FuncExp *fe = (FuncExp *)e; - if (fe->fd && fe->fd->tok == TOKreserved) - { - if (fe->type->ty == Tpointer) - { - fe->fd->vthis = NULL; - fe->fd->tok = TOKfunction; - } - else - { - fe->fd->tok = TOKdelegate; - } - } - } -#endif } L1: - if (flag != 1 && !e) + if (!flag && !e) { error("cannot infer function literal type from %s", to->toChars()); e = new ErrorExp(); } diff --git a/dmd2/expression.c b/dmd2/expression.c index 29f87d52..d7560cc8 100644 --- a/dmd2/expression.c +++ b/dmd2/expression.c @@ -1006,7 +1006,7 @@ Type *functionParameters(Loc loc, Scope *sc, TypeFunction *tf, Type *pt = p->type; if (tf->varargs == 2 && i + 1 == nparams && pt->nextOf()) pt = pt->nextOf(); - arg = arg->inferType(pt, 2); + arg = arg->inferType(pt); (*arguments)[i] = arg; }