summaryrefslogtreecommitdiff
path: root/modules/gdscript/gdscript_warning.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2021-11-23 15:15:36 +0100
committerGitHub <noreply@github.com>2021-11-23 15:15:36 +0100
commit3ba2d17d2f4b5d1b41c7b00f1020100f9efcc1b6 (patch)
tree0791661409e1b775d79aa19fa9986cad0f600a35 /modules/gdscript/gdscript_warning.cpp
parent0cec0d35170695d7c8b803c67cb7266276ab886c (diff)
parent3396b254891db02edb29950e7a2a1c1968612949 (diff)
Merge pull request #54949 from Chaosus/fix_warning
Diffstat (limited to 'modules/gdscript/gdscript_warning.cpp')
-rw-r--r--modules/gdscript/gdscript_warning.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_warning.cpp b/modules/gdscript/gdscript_warning.cpp
index 7a483a16ba..a351bd6dad 100644
--- a/modules/gdscript/gdscript_warning.cpp
+++ b/modules/gdscript/gdscript_warning.cpp
@@ -148,6 +148,10 @@ String GDScriptWarning::get_message() const {
case EMPTY_FILE: {
return "Empty script file.";
}
+ 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]);
+ }
case WARNING_MAX:
break; // Can't happen, but silences warning
}
@@ -194,6 +198,7 @@ String GDScriptWarning::get_name_from_code(Code p_code) {
"ASSERT_ALWAYS_FALSE",
"REDUNDANT_AWAIT",
"EMPTY_FILE",
+ "SHADOWED_GLOBAL_IDENTIFIER",
};
static_assert((sizeof(names) / sizeof(*names)) == WARNING_MAX, "Amount of warning types don't match the amount of warning names.");