Skip to content

warning_ignore attribute ignored in for loop range expression #84719

@j-zeppenfeld

Description

@j-zeppenfeld

Godot version

v4.1.2.stable.official [399c9dc]

System information

Godot v4.1.2.stable - Windows 10.0.19045 - Vulkan (Mobile) - dedicated NVIDIA RTX A2000 Laptop GPU (NVIDIA; 31.0.15.2737) - 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz (16 Threads)

Issue description

The @warning_ignore attribute is ignored or at least not applied as expected to a for loop range expression.

As such it is not possible to ignore a warning in a specific for loop expression. My current workaround is to ignore the warning across the entire function.

Steps to reproduce

func _ready():
	var items: Array = [0, 1, 2, 3, 4]
	@warning_ignore("integer_division")
	for i in items.size() / 2:
		print(i)

The warning about integer division is still shown both in the ide and debugger.

Minimal reproduction project

Trivial to reproduce without a specific project.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions