Revert "GDScript: Fix groups and categories been seen as members"

This reverts commit 6f2a8434c6.

The commit introduces a bug where it creates spurious entries for member
information.
This commit is contained in:
George Marques 2023-02-25 13:40:31 -03:00
parent 3863199ab9
commit eba984a44f
No known key found for this signature in database
GPG key ID: 046BD46A3201E43D
3 changed files with 1 additions and 19 deletions

View file

@ -211,10 +211,6 @@ static bool _can_use_ptrcall(const MethodBind *p_method, const Vector<GDScriptCo
return true;
}
inline static bool is_category_or_group(const PropertyInfo &p_info) {
return p_info.usage & PROPERTY_USAGE_CATEGORY || p_info.usage & PROPERTY_USAGE_GROUP || p_info.usage & PROPERTY_USAGE_SUBGROUP;
}
GDScriptCodeGenerator::Address GDScriptCompiler::_parse_expression(CodeGen &codegen, Error &r_error, const GDScriptParser::ExpressionNode *p_expression, bool p_root, bool p_initializer, const GDScriptCodeGenerator::Address &p_index_addr) {
if (p_expression->is_constant && !(p_expression->get_datatype().is_meta_type && p_expression->get_datatype().kind == GDScriptParser::DataType::CLASS)) {
return codegen.add_constant(p_expression->reduced_value);
@ -250,7 +246,7 @@ GDScriptCodeGenerator::Address GDScriptCompiler::_parse_expression(CodeGen &code
// Try members.
if (!codegen.function_node || !codegen.function_node->is_static) {
// Try member variables.
if (codegen.script->member_indices.has(identifier) && !is_category_or_group(codegen.script->member_info[identifier])) {
if (codegen.script->member_indices.has(identifier)) {
if (codegen.script->member_indices[identifier].getter != StringName() && codegen.script->member_indices[identifier].getter != codegen.function_name) {
// Perform getter.
GDScriptCodeGenerator::Address temp = codegen.add_temporary(codegen.script->member_indices[identifier].data_type);

View file

@ -1,11 +0,0 @@
# https://github.com/godotengine/godot/issues/73843
extends RefCounted
@export_group("Resource")
@export_category("RefCounted")
func test():
var res = Resource.new()
var ref = RefCounted.new()
prints("Resource class not shadowed:", res is Resource)
prints("RefCounted class not shadowed:", ref is RefCounted)

View file

@ -1,3 +0,0 @@
GDTEST_OK
Resource class not shadowed: true
RefCounted class not shadowed: true