summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_warning.cpp
diff options
context:
space:
mode:
authorGeorge L. Albany <Megacake1234@gmail.com>2024-11-11 16:19:19 +0000
committerGitHub <noreply@github.com>2024-11-11 16:19:19 +0000
commit5094c2a5f7d506b0e685120f14d1df42e1e9d495 (patch)
treea10abf56ba93705731da1aaf338f2cf21403c6ad /modules/gdscript/gdscript_warning.cpp
parente7894c2c4efdd51049a21af4892005381fe57cd6 (diff)
parent62fbec9f6f0722a1f9825c17f073742932082228 (diff)
downloadredot-engine-5094c2a5f7d506b0e685120f14d1df42e1e9d495.tar.gz
Merge pull request #853 from Spartan322/merge/0f5f3bc
Merge commit godotengine/godot@0f5f3bc
Diffstat (limited to 'modules/gdscript/gdscript_warning.cpp')
-rw-r--r--modules/gdscript/gdscript_warning.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript_warning.cpp b/modules/gdscript/gdscript_warning.cpp
index 15008eb6fb..0629b23400 100644
--- a/modules/gdscript/gdscript_warning.cpp
+++ b/modules/gdscript/gdscript_warning.cpp
@@ -63,10 +63,13 @@ String GDScriptWarning::get_message() const {
return vformat(R"(The signal "%s" is declared but never explicitly used in the class.)", symbols[0]);
case SHADOWED_VARIABLE:
CHECK_SYMBOLS(4);
- return vformat(R"(The local %s "%s" is shadowing an already-declared %s at line %s.)", symbols[0], symbols[1], symbols[2], symbols[3]);
+ return vformat(R"(The local %s "%s" is shadowing an already-declared %s at line %s in the current class.)", symbols[0], symbols[1], symbols[2], symbols[3]);
case SHADOWED_VARIABLE_BASE_CLASS:
CHECK_SYMBOLS(4);
- return vformat(R"(The local %s "%s" is shadowing an already-declared %s at the base class "%s".)", symbols[0], symbols[1], symbols[2], symbols[3]);
+ if (symbols.size() > 4) {
+ return vformat(R"(The local %s "%s" is shadowing an already-declared %s at line %s in the base class "%s".)", symbols[0], symbols[1], symbols[2], symbols[3], symbols[4]);
+ }
+ return vformat(R"(The local %s "%s" is shadowing an already-declared %s in the base class "%s".)", symbols[0], symbols[1], symbols[2], symbols[3]);
case SHADOWED_GLOBAL_IDENTIFIER:
CHECK_SYMBOLS(3);
return vformat(R"(The %s "%s" has the same name as a %s.)", symbols[0], symbols[1], symbols[2]);