Merge pull request #68911 from souplamp/return-value-discarded-error

Clarify what happens when return value is discarded in GDScript warning text
This commit is contained in:
Rémi Verschelde 2022-11-22 08:30:51 +01:00
commit 28039094b3
No known key found for this signature in database
GPG Key ID: C3336907360768E1
2 changed files with 2 additions and 2 deletions

View File

@ -96,7 +96,7 @@ String GDScriptWarning::get_message() const {
} break;
case RETURN_VALUE_DISCARDED: {
CHECK_SYMBOLS(1);
return "The function '" + symbols[0] + "()' returns a value, but this value is never used.";
return "The function '" + symbols[0] + "()' returns a value that will be discarded if not used.";
} break;
case PROPERTY_USED_AS_FUNCTION: {
CHECK_SYMBOLS(2);

View File

@ -2,4 +2,4 @@ GDTEST_OK
>> WARNING
>> Line: 6
>> RETURN_VALUE_DISCARDED
>> The function 'i_return_int()' returns a value, but this value is never used.
>> The function 'i_return_int()' returns a value that will be discarded if not used.