mirror of
https://github.com/dlang/dmd.git
synced 2025-04-29 14:40:12 +03:00
Merge pull request #14255 from Geod24/useful-attributes-error
Print the inference error trace for regular inference errors Signed-off-by: Dennis <dkorpel@users.noreply.github.com> Signed-off-by: Nicholas Wilson <thewilsonator@users.noreply.github.com> Merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
This commit is contained in:
commit
b156f0a9fc
2 changed files with 23 additions and 20 deletions
|
@ -13133,8 +13133,9 @@ bool checkSharedAccess(Expression e, Scope* sc, bool returnRef = false)
|
||||||
bool checkAddressVar(Scope* sc, Expression exp, VarDeclaration v)
|
bool checkAddressVar(Scope* sc, Expression exp, VarDeclaration v)
|
||||||
{
|
{
|
||||||
//printf("checkAddressVar(exp: %s, v: %s)\n", exp.toChars(), v.toChars());
|
//printf("checkAddressVar(exp: %s, v: %s)\n", exp.toChars(), v.toChars());
|
||||||
if (v)
|
if (v is null)
|
||||||
{
|
return true;
|
||||||
|
|
||||||
if (!v.canTakeAddressOf())
|
if (!v.canTakeAddressOf())
|
||||||
{
|
{
|
||||||
exp.error("cannot take address of `%s`", exp.toChars());
|
exp.error("cannot take address of `%s`", exp.toChars());
|
||||||
|
@ -13153,7 +13154,6 @@ bool checkAddressVar(Scope* sc, Expression exp, VarDeclaration v)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4466,7 +4466,9 @@ void errorSupplementalInferredSafety(FuncDeclaration fd, int maxDepth, bool depr
|
||||||
errorFunc(s.loc, s.fmtStr,
|
errorFunc(s.loc, s.fmtStr,
|
||||||
s.arg0 ? s.arg0.toChars() : "", s.arg1 ? s.arg1.toChars() : "", s.arg2 ? s.arg2.toChars() : "");
|
s.arg0 ? s.arg0.toChars() : "", s.arg1 ? s.arg1.toChars() : "", s.arg2 ? s.arg2.toChars() : "");
|
||||||
}
|
}
|
||||||
else if (FuncDeclaration fd2 = cast(FuncDeclaration) s.arg0)
|
else if (s.arg0.dyncast() == DYNCAST.dsymbol)
|
||||||
|
{
|
||||||
|
if (FuncDeclaration fd2 = (cast(Dsymbol) s.arg0).isFuncDeclaration())
|
||||||
{
|
{
|
||||||
if (maxDepth > 0)
|
if (maxDepth > 0)
|
||||||
{
|
{
|
||||||
|
@ -4475,4 +4477,5 @@ void errorSupplementalInferredSafety(FuncDeclaration fd, int maxDepth, bool depr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue