mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
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:
parent
cec9c370b9
commit
55d9d5aa35
2 changed files with 3 additions and 3 deletions
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
---
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue