mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-19 05:03:13 +01:00
Merged DMD commit ee27f87bd4f02fc3edbeb2d110333cb162427e08:
bugzilla 5164 Error without line number using 'is (T...)'
This commit is contained in:
@@ -163,6 +163,7 @@ void Declaration::checkModify(Loc loc, Scope *sc, Type *t)
|
||||
TupleDeclaration::TupleDeclaration(Loc loc, Identifier *id, Objects *objects)
|
||||
: Declaration(id)
|
||||
{
|
||||
this->loc = loc;
|
||||
this->type = NULL;
|
||||
this->objects = objects;
|
||||
this->isexp = 0;
|
||||
|
||||
@@ -4800,6 +4800,31 @@ Expression *IsExp::semantic(Scope *sc)
|
||||
tded = (Type *)dedtypes.data[0];
|
||||
if (!tded)
|
||||
tded = targ;
|
||||
#if DMDV2
|
||||
Objects tiargs;
|
||||
tiargs.setDim(1);
|
||||
tiargs.data[0] = (void *)targ;
|
||||
|
||||
/* Declare trailing parameters
|
||||
*/
|
||||
for (int i = 1; i < parameters->dim; i++)
|
||||
{ TemplateParameter *tp = (TemplateParameter *)parameters->data[i];
|
||||
Declaration *s = NULL;
|
||||
|
||||
m = tp->matchArg(sc, &tiargs, i, parameters, &dedtypes, &s);
|
||||
if (m == MATCHnomatch)
|
||||
goto Lno;
|
||||
s->semantic(sc);
|
||||
#if 0
|
||||
Object *o = (Object *)dedtypes.data[i];
|
||||
Dsymbol *s = TemplateDeclaration::declareParameter(loc, sc, tp, o);
|
||||
#endif
|
||||
if (sc->sd)
|
||||
s->addMember(sc, sc->sd, 1);
|
||||
else if (!sc->insert(s))
|
||||
error("declaration %s is already defined", s->toChars());
|
||||
}
|
||||
#endif
|
||||
goto Lyes;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3131,7 +3131,10 @@ MATCH TemplateTupleParameter::matchArg(Scope *sc,
|
||||
*/
|
||||
assert(i + 1 == dedtypes->dim); // must be the last one
|
||||
Tuple *ovar;
|
||||
if (i + 1 == tiargs->dim && isTuple((Object *)tiargs->data[i]))
|
||||
if (dedtypes->data[i] && isTuple((Object *)dedtypes->data[i]))
|
||||
// It was already been deduced
|
||||
ovar = isTuple((Object *)dedtypes->data[i]);
|
||||
else if (i + 1 == tiargs->dim && isTuple((Object *)tiargs->data[i]))
|
||||
ovar = isTuple((Object *)tiargs->data[i]);
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user