mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Add opt-in GDScript warning for when calling coroutine without await
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
func coroutine() -> void:
|
||||
@warning_ignore("redundant_await")
|
||||
await 0
|
||||
|
||||
func test():
|
||||
await coroutine()
|
||||
coroutine()
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_OK
|
||||
~~ WARNING at line 7: (MISSING_AWAIT) "await" keyword might be desired because the expression is a coroutine.
|
||||
@@ -15,11 +15,14 @@ func await_two_parameters():
|
||||
print(result)
|
||||
|
||||
func test():
|
||||
@warning_ignore("missing_await")
|
||||
await_no_parameters()
|
||||
no_parameters.emit()
|
||||
|
||||
@warning_ignore("missing_await")
|
||||
await_one_parameter()
|
||||
one_parameter.emit(1)
|
||||
|
||||
@warning_ignore("missing_await")
|
||||
await_two_parameters()
|
||||
two_parameters.emit(1, 2)
|
||||
|
||||
@@ -8,5 +8,6 @@ func async_func():
|
||||
my_signal.emit()
|
||||
|
||||
func test():
|
||||
@warning_ignore("missing_await")
|
||||
async_func()
|
||||
my_signal.emit()
|
||||
|
||||
Reference in New Issue
Block a user