Skip to content

UNUSED_SIGNAL warning if signal is only used via emit_signal()  #89632

Closed
@lostminds

Description

@lostminds

Tested versions

v4.3.dev5
not reproducable in v4.3.dev4

System information

macOS 14.4

Issue description

If you emit signals using emit_signal("signal_name") this will no longer register in 4.3dev5 as using this signal and trigger an UNUSED_SIGNAL warning for the signal.

Steps to reproduce

Write a simple script like

extends Node

signal value_changed()

var value:bool = false:
	set(new_value):
		if (new_value != value):
			value = new_value
			emit_signal("value_changed")

And observer the warning:
Line 3 (UNUSED_SIGNAL):The signal "value_changed" is declared but never explicitly used in the class.

If you instead use value_changed.emit() the warning is not shown.

If the script is used in the project you'll get a similar warning in the debug output running the game.

Minimal reproduction project (MRP)

See script lines above.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions