Skip to content

Debugger's evaluator returns null when using enums from different script #103963

Closed
@artturipi

Description

@artturipi

Tested versions

Reproducible in v4.4.stable.official [4c311cb]

System information

Godot v4.4.stable - macOS Sequoia (15.0.1) - Multi-window, 2 monitors - Vulkan (Forward+) - dedicated AMD Radeon Pro 5300M - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz (12 threads)

Issue description

Debugger evaulator returns null when trying to evaluate enums from another script. The code and the if statements works as expected when running the program, but in this example the evaluator cannot be used to determine path taken in execution in "OtherNode" script.

Example code with two nodes & scripts:

class_name EnumNode
extends Node2D

enum Numbs {
	ONE,
	TWO
}

func _init() -> void:
	var evaluator_success : Numbs = Numbs.ONE
	if evaluator_success == Numbs.ONE :
		print("all good, evaluator works fine here")
		# place breakpoint on line with if statement
		# try evaulating EnumNode.Numbs.ONE or evaluator_success == EnumNode.Numbs.ONE and you'll get correct results
class_name OtherNode
extends Node2D

func _init() -> void:
	var fails = EnumNode.Numbs.ONE
	if fails == EnumNode.Numbs.ONE :
		print("this is printed, but debugger evaluator fails to check if statement")
		# place breakpoint on line with if statement
		# try evaulating EnumNode.Numbs.ONE or fails == EnumNode.Numbs.ONE and you'll get null

Steps to reproduce

Set debugger breakpoint and evaluate expressions with enums. See the different behaviour depending on if the enum is in the same script or not.

Minimal reproduction project (MRP)

enum_evaluate_debugger_bug_repro.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions