1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-16 14:00:40 +00:00

set has_type false if it is BUILTIN but Variant::NIL

This commit is contained in:
emre0altan
2024-02-06 13:25:00 +00:00
parent d3352813ea
commit 081fa324fd
3 changed files with 9 additions and 1 deletions

View File

@@ -429,7 +429,7 @@ void GDScriptByteCodeGenerator::set_initial_line(int p_line) {
(m_var.type.has_type && m_var.type.kind == GDScriptDataType::BUILTIN) (m_var.type.has_type && m_var.type.kind == GDScriptDataType::BUILTIN)
#define IS_BUILTIN_TYPE(m_var, m_type) \ #define IS_BUILTIN_TYPE(m_var, m_type) \
(m_var.type.has_type && m_var.type.kind == GDScriptDataType::BUILTIN && m_var.type.builtin_type == m_type) (m_var.type.has_type && m_var.type.kind == GDScriptDataType::BUILTIN && m_var.type.builtin_type == m_type && m_type != Variant::NIL)
void GDScriptByteCodeGenerator::write_type_adjust(const Address &p_target, Variant::Type p_new_type) { void GDScriptByteCodeGenerator::write_type_adjust(const Address &p_target, Variant::Type p_new_type) {
switch (p_new_type) { switch (p_new_type) {

View File

@@ -0,0 +1,6 @@
func test():
match null:
null:
print('null matched')
_:
pass

View File

@@ -0,0 +1,2 @@
GDTEST_OK
null matched