make deprecation message less confusing

the deprecation message talks about the function we are using, not some arbitrary example that you would use "such as" with.
This commit is contained in:
WebFreak001 2023-05-17 13:31:05 +02:00 committed by The Dlang Bot
parent cec9c370b9
commit 55d9d5aa35
2 changed files with 3 additions and 3 deletions

View file

@ -1215,7 +1215,7 @@ Expression semanticTraits(TraitsExp e, Scope* sc)
{
if (fd.overnext)
{
deprecation(e.loc, "`__traits(getAttributes)` may only be used for individual functions, not overload sets such as: `%s`", fd.toChars());
deprecation(e.loc, "`__traits(getAttributes)` may only be used for individual functions, not the overload set `%s`", fd.toChars());
deprecationSupplemental(e.loc, "the result of `__traits(getOverloads)` may be used to select the desired function to extract attributes from");
}
}
@ -1225,7 +1225,7 @@ Expression semanticTraits(TraitsExp e, Scope* sc)
{
if (td.overnext || td.funcroot)
{
deprecation(e.loc, "`__traits(getAttributes)` may only be used for individual functions, not overload sets such as: `%s`", td.ident.toChars());
deprecation(e.loc, "`__traits(getAttributes)` may only be used for individual functions, not the overload set `%s`", td.ident.toChars());
deprecationSupplemental(e.loc, "the result of `__traits(getOverloads)` may be used to select the desired function to extract attributes from");
}
}

View file

@ -5,7 +5,7 @@
/*
TEST_OUTPUT:
---
fail_compilation/fail15414.d(20): Deprecation: `__traits(getAttributes)` may only be used for individual functions, not overload sets such as: `fun`
fail_compilation/fail15414.d(20): Deprecation: `__traits(getAttributes)` may only be used for individual functions, not the overload set `fun`
fail_compilation/fail15414.d(20): the result of `__traits(getOverloads)` may be used to select the desired function to extract attributes from
---
*/