Merge pull request #72677 from dalexeev/gds-await-infer-type

GDScript: Fix `await` type inference
This commit is contained in:
Yuri Sizov 2023-02-06 23:32:28 +03:00 committed by GitHub
commit c0edea37ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 13 deletions

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