summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests/scripts/analyzer/features
diff options
context:
space:
mode:
authorDanil Alexeev <danil@alexeev.xyz>2023-02-03 20:51:00 +0300
committerDanil Alexeev <danil@alexeev.xyz>2023-02-06 23:02:14 +0300
commit685db28e2920150737bc53d5c86dcc64cc42bb60 (patch)
treef9a4ba00e49a5ae43bed3f6718a039471276eeb2 /modules/gdscript/tests/scripts/analyzer/features
parentde4369ca4b5516b69d78b5cf979af14fbe997f40 (diff)
downloadredot-engine-685db28e2920150737bc53d5c86dcc64cc42bb60.tar.gz
GDScript: Fix `await` type inference
Diffstat (limited to 'modules/gdscript/tests/scripts/analyzer/features')
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/await_type_inference.gd15
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/await_type_inference.out2
2 files changed, 17 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/analyzer/features/await_type_inference.gd b/modules/gdscript/tests/scripts/analyzer/features/await_type_inference.gd
new file mode 100644
index 0000000000..9d8cfc7f99
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/features/await_type_inference.gd
@@ -0,0 +1,15 @@
+func coroutine() -> int:
+ @warning_ignore("redundant_await")
+ await 0
+ return 1
+
+func not_coroutine() -> int:
+ return 2
+
+func test():
+ var a := await coroutine()
+ @warning_ignore("redundant_await")
+ var b := await not_coroutine()
+ @warning_ignore("redundant_await")
+ var c := await 3
+ prints(a, b, c)
diff --git a/modules/gdscript/tests/scripts/analyzer/features/await_type_inference.out b/modules/gdscript/tests/scripts/analyzer/features/await_type_inference.out
new file mode 100644
index 0000000000..2920e2ce9c
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/features/await_type_inference.out
@@ -0,0 +1,2 @@
+GDTEST_OK
+1 2 3