1
0
Fork 0
This commit is contained in:
Rune 2025-02-28 01:36:42 +01:00 committed by GitHub
commit be4a6ac040
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 0 deletions

View File

@ -3064,6 +3064,13 @@ void GDScriptAnalyzer::reduce_binary_op(GDScriptParser::BinaryOpNode *p_binary_o
} }
#endif #endif
bool lhs_is_stringy = left_type.kind == GDScriptParser::DataType::BUILTIN && (left_type.builtin_type == Variant::STRING || left_type.builtin_type == Variant::STRING_NAME);
bool rhs_is_meta_class = right_type.kind == GDScriptParser::DataType::CLASS && right_type.is_meta_type;
if (lhs_is_stringy && p_binary_op->variant_op == Variant::OP_IN && rhs_is_meta_class) {
// TODO: Some script members presence could be determined here.
return;
}
if (p_binary_op->left_operand->is_constant && p_binary_op->right_operand->is_constant) { if (p_binary_op->left_operand->is_constant && p_binary_op->right_operand->is_constant) {
p_binary_op->is_constant = true; p_binary_op->is_constant = true;
if (p_binary_op->variant_op < Variant::OP_MAX) { if (p_binary_op->variant_op < Variant::OP_MAX) {

View File

@ -0,0 +1,6 @@
class MyClass:
static func my_static():
print("my_static")
func test():
print("my_static" in MyClass)