diff options
author | George Marques <george@gmarqu.es> | 2021-06-03 09:51:51 -0300 |
---|---|---|
committer | George Marques <george@gmarqu.es> | 2021-08-18 18:58:41 -0300 |
commit | 1c8b0765023cd0be8abf0e738070842ee5b114fc (patch) | |
tree | 6e0cd1106db65b4379927511b238e980b778a9a7 | |
parent | 47545aeb1ac089c8e252973e6b2f0b9c3fcee7d8 (diff) |
GDScript: Fix calling builtin static functions
3 files changed, 9 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index 9e6bf3e080..57d999f8af 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -3248,7 +3248,9 @@ bool GDScriptAnalyzer::get_function_signature(GDScriptParser::CallNode *p_source for (const MethodInfo &E : methods) { if (E.name == p_function) { - return function_signature_from_info(E, r_return_type, r_par_types, r_default_arg_count, r_static, r_vararg); + function_signature_from_info(E, r_return_type, r_par_types, r_default_arg_count, r_static, r_vararg); + r_static = Variant::is_builtin_method_static(p_base_type.builtin_type, function_name); + return true; } } diff --git a/modules/gdscript/tests/scripts/analyzer/features/call_static_builtin_function.gd b/modules/gdscript/tests/scripts/analyzer/features/call_static_builtin_function.gd new file mode 100644 index 0000000000..ac66b78220 --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/features/call_static_builtin_function.gd @@ -0,0 +1,3 @@ +func test(): + print(Color.html_is_valid("00ffff")) + print("OK") diff --git a/modules/gdscript/tests/scripts/analyzer/features/call_static_builtin_function.out b/modules/gdscript/tests/scripts/analyzer/features/call_static_builtin_function.out new file mode 100644 index 0000000000..75b002aa62 --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/features/call_static_builtin_function.out @@ -0,0 +1,3 @@ +GDTEST_OK +True +OK |