summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-10-08 07:45:42 +0200
committerGitHub <noreply@github.com>2021-10-08 07:45:42 +0200
commit89ed936ea1a821582cc2a082cad8a539e0036339 (patch)
treefc788059ebd4d16348ecdf94e912f57fa02384f2
parent49e7e049aba1dad3d778a4aea4afa23203ad795b (diff)
parent3a856b4fcc7433ac0fc2857d12e2e9b0f7395d5a (diff)
Merge pull request #52911 from vnen/gdscript-use-getter-for-property-type
Use getter return type for the property type
-rw-r--r--modules/gdscript/gdscript_analyzer.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp
index 3abd8672fa..2dafc85f45 100644
--- a/modules/gdscript/gdscript_analyzer.cpp
+++ b/modules/gdscript/gdscript_analyzer.cpp
@@ -2608,10 +2608,13 @@ void GDScriptAnalyzer::reduce_identifier_from_base(GDScriptParser::IdentifierNod
const StringName &native = base.native_type;
if (class_exists(native)) {
- PropertyInfo prop_info;
MethodInfo method_info;
- if (ClassDB::get_property_info(native, name, &prop_info)) {
- p_identifier->set_datatype(type_from_property(prop_info));
+ if (ClassDB::has_property(native, name)) {
+ StringName getter_name = ClassDB::get_property_getter(native, name);
+ MethodBind *getter = ClassDB::get_method(native, getter_name);
+ if (getter != nullptr) {
+ p_identifier->set_datatype(type_from_property(getter->get_return_info()));
+ }
return;
}
if (ClassDB::get_method_info(native, name, &method_info)) {