Merge pull request #115461 from HolonProduction/gdscript/noroutine

GDScript: Prevent function states from leaking into typed temporaries, when overwriting with coroutines
This commit is contained in:
Thaddeus Crews
2026-06-18 15:14:14 -05:00
3 changed files with 33 additions and 2 deletions
@@ -0,0 +1,24 @@
class BaseClass:
signal release_bool
func get_bool() -> bool:
return true
class InheritedClass extends BaseClass:
func get_bool() -> bool:
await release_bool
return false
var instance: BaseClass = InheritedClass.new()
func test() -> void:
@warning_ignore("missing_await")
await_with_overwritten_coroutine()
instance.release_bool.emit()
func await_with_overwritten_coroutine():
var res_v := await instance.get_bool()
print(res_v == true)
var result: bool = bool(res_v)
print(result == true)
@@ -0,0 +1,4 @@
GDTEST_OK
~~ WARNING at line 21: (REDUNDANT_AWAIT) "await" keyword is unnecessary because the expression isn't a coroutine nor a signal.
false
false