You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @brief Attempts to look up the function signature for a function based on name and base type.
134
+
*
135
+
* @param[in] p_source The source node in context of which the signature is being resolved. Used for error reporting.
136
+
* @param[in] p_is_constructor If the target function call is a constructor. In this case `p_function` is always "new".
137
+
* @param[in] base_type The target type to resolve the function on. If looking for a function `SomeClass.a_function()`, this is `SomeClass`.
138
+
* @param[in] p_function The name of the target function.
139
+
* @param[out] r_return_type The return type of the found function.
140
+
* @param[out] r_par_types A list of the parameters types of the found function, in order from left to right.
141
+
* @param[out] r_default_arg_count The number of parameters which have default values.
142
+
* @param[out] r_method_flags The flags of the found function.
143
+
* @param[out] r_native_class If DEBUG_ENABLED=1, and the found function is a native method, the string name of the owning native class. Otherwise an empty string name.
144
+
*
145
+
* @return True if the function signature was successfully resolved, false otherwise. See the remaining output variables for other data.
returnvformat(R"*(The default value uses "%s" which won't return nodes in the scene tree before "_ready()" is called. Use the "@onready" annotation to solve this.)*", symbols[0]);
163
163
case ONREADY_WITH_EXPORT:
164
164
returnR"("@onready" will set the default value after "@export" takes effect and will override it.)";
165
+
case IMPLICIT_FUNCTION_OVERRIDE:
166
+
CHECK_SYMBOLS(2);
167
+
returnvformat(R"*(The method "%s()" overrides "%s::%s()" but does not have the @override annotation.)*", symbols[0], symbols[1], symbols[0]);
165
168
#ifndef DISABLE_DEPRECATED
166
169
// Never produced. These warnings migrated from 3.x by mistake.
167
170
case PROPERTY_USED_AS_FUNCTION: // There is already an error.
Copy file name to clipboardExpand all lines: modules/gdscript/gdscript_warning.h
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -89,6 +89,7 @@ class GDScriptWarning {
89
89
NATIVE_METHOD_OVERRIDE, // The script method overrides a native one, this may not work as intended.
90
90
GET_NODE_DEFAULT_WITHOUT_ONREADY, // A class variable uses `get_node()` (or the `$` notation) as its default value, but does not use the @onready annotation.
91
91
ONREADY_WITH_EXPORT, // The `@onready` annotation will set the value after `@export` which is likely not intended.
92
+
IMPLICIT_FUNCTION_OVERRIDE, // A function overrides a function in a parent class, but does not have the `@override` annotation.
92
93
#ifndef DISABLE_DEPRECATED
93
94
PROPERTY_USED_AS_FUNCTION, // Function not found, but there's a property with the same name.
94
95
CONSTANT_USED_AS_FUNCTION, // Function not found, but there's a constant with the same name.
@@ -146,6 +147,7 @@ class GDScriptWarning {
146
147
ERROR, // NATIVE_METHOD_OVERRIDE // May not work as expected.
147
148
ERROR, // GET_NODE_DEFAULT_WITHOUT_ONREADY // May not work as expected.
148
149
ERROR, // ONREADY_WITH_EXPORT // May not work as expected.
0 commit comments