You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
GDScript: Properly return value with await on non-coroutine
If the keyword `await` is used without a coroutine, it should still return the value synchronally.
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
# https://github.com/godotengine/godot/issues/50894
|
||||
|
||||
func test():
|
||||
print(await not_coroutine())
|
||||
|
||||
|
||||
func not_coroutine():
|
||||
return "awaited"
|
||||
@@ -0,0 +1,6 @@
|
||||
GDTEST_OK
|
||||
>> WARNING
|
||||
>> Line: 4
|
||||
>> REDUNDANT_AWAIT
|
||||
>> "await" keyword not needed in this case, because the expression isn't a coroutine nor a signal.
|
||||
awaited
|
||||
Reference in New Issue
Block a user