mirror of
https://github.com/dlang/dmd.git
synced 2025-04-27 21:51:03 +03:00
Merge pull request #7472 from JinShil/funcexp
Improve FuncExp: Do nothing if type is already set in semantic merged-on-behalf-of: Iain Buclaw <ibuclaw@gdcproject.org>
This commit is contained in:
commit
38aadf0081
1 changed files with 91 additions and 86 deletions
|
@ -2554,14 +2554,20 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
|
|||
if (exp.fd.treq)
|
||||
printf(" treq = %s\n", exp.fd.treq.toChars());
|
||||
}
|
||||
|
||||
if (exp.type)
|
||||
{
|
||||
result = exp;
|
||||
return;
|
||||
}
|
||||
|
||||
Expression e = exp;
|
||||
uint olderrors;
|
||||
|
||||
sc = sc.push(); // just create new scope
|
||||
sc.flags &= ~SCOPEctfe; // temporary stop CTFE
|
||||
sc.protection = Prot(PROTpublic); // https://issues.dlang.org/show_bug.cgi?id=12506
|
||||
|
||||
if (!exp.type || exp.type == Type.tvoid)
|
||||
{
|
||||
/* fd.treq might be incomplete type,
|
||||
* so should not semantic it.
|
||||
* void foo(T)(T delegate(int) dg){}
|
||||
|
@ -2603,7 +2609,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
|
|||
goto Ldone;
|
||||
}
|
||||
|
||||
uint olderrors = global.errors;
|
||||
olderrors = global.errors;
|
||||
exp.fd.dsymbolSemantic(sc);
|
||||
if (olderrors == global.errors)
|
||||
{
|
||||
|
@ -2649,7 +2655,6 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
|
|||
}
|
||||
}
|
||||
exp.fd.tookAddressOf++;
|
||||
}
|
||||
|
||||
Ldone:
|
||||
sc = sc.pop();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue