Open hsandt opened 1 month ago
According to the source this is a limitation: https://github.com/godotengine/godot/blob/88f3b5f9d52f740b24fabfb8bc01b8b7026ba279/modules/gdscript/gdscript_analyzer.cpp#L2877-L2880
Seems reproducible in 4.3.rc3 and 4.2.2.stable.
Yet, said type can be deduced from the signal's signature.
The signal signature is nominal (used in documentation and by the editor when generating a callback). Neither core nor GDScript checks the number and types of arguments passed to emit()
.
Tested versions
System information
Godot v4.3.rc2 - Ubuntu 22.04.4 LTS 22.04 - X11 - GLES3 (Compatibility) - NVIDIA GeForce GTX 860M (nvidia; 535.183.01) - Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz (8 Threads)
Issue description
I'm trying to retrieve the parameters/arguments passed to a signal as I
await
the signal. For convenience, I use type deducation:I get a parser error on the line using type deduction:
Yet, said type can be deduced from the signal's signature.
Signals don't allow default values so there is no ambiguity on the number of arguments passed either.
Steps to reproduce
Note: this is a dummy example and is not functional. If you really want to see the code in action you need to emit
my_signal
from somewhere else, then printsignal_arg
. But if you only want to check the Parser Error, this is not required.Minimal reproduction project (MRP)
N/A