summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_analyzer.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-09-20 13:09:17 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-09-20 13:09:17 +0200
commit971f678442a3754d4a2f1dd53b97a8e900fa9a4c (patch)
tree02d0cd2f3fc4a4989a79e83796456e1594924398 /modules/gdscript/gdscript_analyzer.cpp
parent21b132616bf167bf42e019cf3b7757ca56ea28b3 (diff)
parentc35cb51d7432f32ed04357f0d09875bce8288b4e (diff)
downloadredot-engine-971f678442a3754d4a2f1dd53b97a8e900fa9a4c.tar.gz
Merge pull request #79510 from dalexeev/gds-fix-const-non-metatype-subscript
GDScript: Fix subscript resolution for constant non-metatypes
Diffstat (limited to 'modules/gdscript/gdscript_analyzer.cpp')
-rw-r--r--modules/gdscript/gdscript_analyzer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp
index 077b30a7fe..87ad6f4cea 100644
--- a/modules/gdscript/gdscript_analyzer.cpp
+++ b/modules/gdscript/gdscript_analyzer.cpp
@@ -4099,7 +4099,7 @@ void GDScriptAnalyzer::reduce_subscript(GDScriptParser::SubscriptNode *p_subscri
GDScriptParser::DataType base_type = p_subscript->base->get_datatype();
bool valid = false;
// If the base is a metatype, use the analyzer instead.
- if (p_subscript->base->is_constant && !base_type.is_meta_type) {
+ if (p_subscript->base->is_constant && !base_type.is_meta_type && base_type.kind != GDScriptParser::DataType::CLASS) {
// Just try to get it.
Variant value = p_subscript->base->reduced_value.get_named(p_subscript->attribute->name, valid);
if (valid) {