From 3228fdb88a3a366abf336f34ff00e2258d85d79b Mon Sep 17 00:00:00 2001 From: rune-scape Date: Thu, 22 Dec 2022 06:02:34 -0500 Subject: Fix GDScript analyzer null literal --- .../tests/scripts/analyzer/features/inferred_return_type.gd | 9 +++++++++ .../tests/scripts/analyzer/features/inferred_return_type.out | 2 ++ 2 files changed, 11 insertions(+) create mode 100644 modules/gdscript/tests/scripts/analyzer/features/inferred_return_type.gd create mode 100644 modules/gdscript/tests/scripts/analyzer/features/inferred_return_type.out (limited to 'modules/gdscript/tests/scripts/analyzer') diff --git a/modules/gdscript/tests/scripts/analyzer/features/inferred_return_type.gd b/modules/gdscript/tests/scripts/analyzer/features/inferred_return_type.gd new file mode 100644 index 0000000000..39ced354df --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/features/inferred_return_type.gd @@ -0,0 +1,9 @@ +# https://github.com/godotengine/godot/issues/61159 + +func get_param(): + return null + +func test(): + var v = get_param() + v = get_param() + print(v) diff --git a/modules/gdscript/tests/scripts/analyzer/features/inferred_return_type.out b/modules/gdscript/tests/scripts/analyzer/features/inferred_return_type.out new file mode 100644 index 0000000000..f0c83a69b3 --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/features/inferred_return_type.out @@ -0,0 +1,2 @@ +GDTEST_OK + -- cgit v1.2.3