summaryrefslogtreecommitdiff
path: root/modules/gdscript/tests/scripts/analyzer/features
diff options
context:
space:
mode:
authorocean (they/them) <anvilfolk@gmail.com>2023-02-17 09:25:57 -0500
committerocean (they/them) <anvilfolk@gmail.com>2023-02-17 11:45:56 -0500
commit9eb4d1e4bff23a4ea80af606a9bbfff1a884e221 (patch)
tree1ff51285a51dcc16ce8d00b701dff9aa99d213a7 /modules/gdscript/tests/scripts/analyzer/features
parent6e0dd6beca4ac9f62ecf27f33c99d456d5871f7f (diff)
Fix inability to assign null regression
Co-authored-by: Dmitry Maganov <vonagam@gmail.com>
Diffstat (limited to 'modules/gdscript/tests/scripts/analyzer/features')
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/native_typed_assign_null.gd15
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/native_typed_assign_null.out7
2 files changed, 22 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/analyzer/features/native_typed_assign_null.gd b/modules/gdscript/tests/scripts/analyzer/features/native_typed_assign_null.gd
new file mode 100644
index 0000000000..c197062d9f
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/features/native_typed_assign_null.gd
@@ -0,0 +1,15 @@
+extends Node
+
+func test():
+ var typed: Variant = get_node_or_null("does_not_exist")
+ var untyped = null
+ var node_1: Node = typed
+ var node_2: Node = untyped
+ var node_3 = typed
+ var node_4 = untyped
+ print(typed)
+ print(untyped)
+ print(node_1)
+ print(node_2)
+ print(node_3)
+ print(node_4)
diff --git a/modules/gdscript/tests/scripts/analyzer/features/native_typed_assign_null.out b/modules/gdscript/tests/scripts/analyzer/features/native_typed_assign_null.out
new file mode 100644
index 0000000000..d66b72f5c3
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/features/native_typed_assign_null.out
@@ -0,0 +1,7 @@
+GDTEST_OK
+<Object#null>
+<null>
+<Object#null>
+<null>
+<Object#null>
+<null>