mirror of https://github.com/godotengine/godot
Merge 3f451c59c9 into 15ff450680
This commit is contained in:
commit
be4a6ac040
|
|
@ -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) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
class MyClass:
|
||||||
|
static func my_static():
|
||||||
|
print("my_static")
|
||||||
|
|
||||||
|
func test():
|
||||||
|
print("my_static" in MyClass)
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
GDTEST_OK
|
||||||
|
true
|
||||||
Loading…
Reference in New Issue