diff options
author | Danil Alexeev <danil@alexeev.xyz> | 2023-09-22 20:57:24 +0300 |
---|---|---|
committer | Danil Alexeev <danil@alexeev.xyz> | 2023-09-22 23:13:52 +0300 |
commit | 4ce27301d3baec04f8259db9a3bc5dacbe359304 (patch) | |
tree | 9c8331d23cf860da828fa921015adf9b5f79ddef /modules/gdscript/gdscript_warning.cpp | |
parent | fe5b1c8d49313d63fbe91cb7cdf463e10fb86afa (diff) | |
download | redot-engine-4ce27301d3baec04f8259db9a3bc5dacbe359304.tar.gz |
GDScript: Add `INFERRED_DECLARATION` warning
Diffstat (limited to 'modules/gdscript/gdscript_warning.cpp')
-rw-r--r-- | modules/gdscript/gdscript_warning.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_warning.cpp b/modules/gdscript/gdscript_warning.cpp index ef2913926c..a0078f84d6 100644 --- a/modules/gdscript/gdscript_warning.cpp +++ b/modules/gdscript/gdscript_warning.cpp @@ -94,6 +94,9 @@ String GDScriptWarning::get_message() const { return vformat(R"*(%s "%s()" has no static return type.)*", symbols[0], symbols[1]); } return vformat(R"(%s "%s" has no static type.)", symbols[0], symbols[1]); + case INFERRED_DECLARATION: + CHECK_SYMBOLS(2); + return vformat(R"(%s "%s" has an implicitly inferred static type.)", symbols[0], symbols[1]); case UNSAFE_PROPERTY_ACCESS: CHECK_SYMBOLS(2); return vformat(R"(The property "%s" is not present on the inferred type "%s" (but may be present on a subtype).)", symbols[0], symbols[1]); @@ -207,6 +210,7 @@ String GDScriptWarning::get_name_from_code(Code p_code) { "CONSTANT_USED_AS_FUNCTION", "FUNCTION_USED_AS_PROPERTY", "UNTYPED_DECLARATION", + "INFERRED_DECLARATION", "UNSAFE_PROPERTY_ACCESS", "UNSAFE_METHOD_ACCESS", "UNSAFE_CAST", |