GDScript: Fix await type inference

This commit is contained in:
Danil Alexeev
2023-02-03 20:51:00 +03:00
parent de4369ca4b
commit 685db28e29
5 changed files with 33 additions and 13 deletions

View File

@@ -0,0 +1,4 @@
signal my_signal()
func test():
var _a := await my_signal

View File

@@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Cannot infer the type of "_a" variable because the value doesn't have a set type.

View File

@@ -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)

View File

@@ -0,0 +1,2 @@
GDTEST_OK
1 2 3