summaryrefslogtreecommitdiff
path: root/modules/gdscript/tests/scripts/analyzer
diff options
context:
space:
mode:
authorrune-scape <allie.smith.epic@gmail.com>2022-12-12 00:58:26 -0500
committerrune-scape <allie.smith.epic@gmail.com>2022-12-12 19:57:26 -0500
commit7d0d6aa16f1c59adb94cd98f6a5d4980cfff0697 (patch)
tree9df5e87968ca0845c598200df36bdbfaba8d5290 /modules/gdscript/tests/scripts/analyzer
parent0580790140834cc2c887f97cc181fd9ee803c91c (diff)
GDScript: Fix cast producing null
Diffstat (limited to 'modules/gdscript/tests/scripts/analyzer')
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/cast_non_null.gd5
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/cast_non_null.out3
2 files changed, 8 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/analyzer/features/cast_non_null.gd b/modules/gdscript/tests/scripts/analyzer/features/cast_non_null.gd
new file mode 100644
index 0000000000..ba1b198cbf
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/features/cast_non_null.gd
@@ -0,0 +1,5 @@
+# https://github.com/godotengine/godot/issues/69504#issuecomment-1345725988
+
+func test():
+ print("cast to Variant == null: ", 1 as Variant == null)
+ print("cast to Object == null: ", self as Object == null)
diff --git a/modules/gdscript/tests/scripts/analyzer/features/cast_non_null.out b/modules/gdscript/tests/scripts/analyzer/features/cast_non_null.out
new file mode 100644
index 0000000000..541de99b8e
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/features/cast_non_null.out
@@ -0,0 +1,3 @@
+GDTEST_OK
+cast to Variant == null: false
+cast to Object == null: false