Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signal's "emit" method cannot be accessed as a Callable property #89369

Closed
bbrainstormer opened this issue Mar 11, 2024 · 2 comments
Closed

Signal's "emit" method cannot be accessed as a Callable property #89369

bbrainstormer opened this issue Mar 11, 2024 · 2 comments
Labels

Comments

@bbrainstormer
Copy link

bbrainstormer commented Mar 11, 2024

Tested versions

  • Reproducible in: 4.2.2-rc1, 4.2.stable, 4.1.stable
  • Not reproducible in 4.3-dev4
    This makes me think that the issue has already been addressed, but I couldn't find an issue anywhere

System information

Godot v4.2.1.stable.mono (b09f793) - Freedesktop SDK 23.08 (Flatpak runtime) - X11 - Vulkan (Forward+) - integrated Intel(R) Xe Graphics (TGL GT2) () - 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz (8 Threads)

Issue description

The signal class's emit method is not accessible as a property of type Callable. This means that if you have the following code:

var emit_method: Callable = my_signal.emit

The code does not run, and you're left with the following errors

res://signal_test.gd:6 - Parse Error: Cannot find property "emit" on base "Signal".
res://signal_test.gd:6 - Parse Error: Cannot find member "emit" in base "Signal".

If you're curious as to use cases, this prevents me from doing things like this:

# Wait until idle time to emit a signal
my_signal.emit.call_deferred()

Which is far nicer than something like

# Gross
(func(): my_signal.emit()).call_deferred()

Steps to reproduce

  1. Open the attached MRP
  2. Open the signal_test.gd code file
  3. Notice the errors on line 6

Minimal reproduction project (MRP)

Signal Bug.zip

@MewPurPur
Copy link
Contributor

It was addressed. #82264

@bbrainstormer
Copy link
Author

It was addressed. #82264

My bad then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants