Merge of v2.063.2

This commit is contained in:
kai
2013-06-29 19:01:42 +02:00
parent 508bf67e2d
commit 7faa23f99c
6 changed files with 57 additions and 33 deletions

View File

@@ -8412,6 +8412,8 @@ Lagain:
{
e1 = new DotVarExp(loc, dte->e1, f);
e1 = e1->semantic(sc);
if (e1->op == TOKerror)
return new ErrorExp();
ue = (UnaExp *)e1;
}
#if 0
@@ -8872,31 +8874,34 @@ Expression *AddrExp::semantic(Scope *sc)
{
DotTemplateInstanceExp* dti = (DotTemplateInstanceExp *)e1;
TemplateInstance *ti = dti->ti;
assert(!ti->semanticRun);
//assert(ti->needsTypeInference(sc));
ti->semantic(sc);
if (!ti->inst) // if template failed to expand
return new ErrorExp;
Dsymbol *s = ti->inst->toAlias();
FuncDeclaration *f = s->isFuncDeclaration();
assert(f);
e1 = new DotVarExp(e1->loc, dti->e1, f);
e1 = e1->semantic(sc);
if (!ti->semanticRun)
{
//assert(ti->needsTypeInference(sc));
ti->semantic(sc);
if (!ti->inst) // if template failed to expand
return new ErrorExp;
Dsymbol *s = ti->inst->toAlias();
FuncDeclaration *f = s->isFuncDeclaration();
assert(f);
e1 = new DotVarExp(e1->loc, dti->e1, f);
e1 = e1->semantic(sc);
}
}
else if (e1->op == TOKimport &&
((ScopeExp *)e1)->sds->isTemplateInstance())
else if (e1->op == TOKimport)
{
TemplateInstance *ti = (TemplateInstance *)((ScopeExp *)e1)->sds;
assert(!ti->semanticRun);
//assert(ti->needsTypeInference(sc));
ti->semantic(sc);
if (!ti->inst) // if template failed to expand
return new ErrorExp;
Dsymbol *s = ti->inst->toAlias();
FuncDeclaration *f = s->isFuncDeclaration();
assert(f);
e1 = new VarExp(e1->loc, f);
e1 = e1->semantic(sc);
TemplateInstance *ti = ((ScopeExp *)e1)->sds->isTemplateInstance();
if (ti && !ti->semanticRun)
{
//assert(ti->needsTypeInference(sc));
ti->semantic(sc);
if (!ti->inst) // if template failed to expand
return new ErrorExp;
Dsymbol *s = ti->inst->toAlias();
FuncDeclaration *f = s->isFuncDeclaration();
assert(f);
e1 = new VarExp(e1->loc, f);
e1 = e1->semantic(sc);
}
}
e1 = e1->toLvalue(sc, NULL);
if (e1->op == TOKerror)
@@ -11099,7 +11104,7 @@ Ltupleassign:
// Disallow sa = e (Converted to sa[] = e)
const char* e1str = e1->toChars();
const char* e2str = e2->toChars();
if (e2->op == TOKslice || t2->implicitConvTo(t1->nextOf()))
if (e2->op == TOKslice || e2->implicitConvTo(t1->nextOf()))
warning("explicit element-wise assignment (%s)[] = %s is better than %s = %s",
e1str, e2str, e1str, e2str);
else