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

warning_ignore attribute ignored in for loop range expression #84719

Closed
j-zeppenfeld opened this issue Nov 10, 2023 · 2 comments · Fixed by #83037
Closed

warning_ignore attribute ignored in for loop range expression #84719

j-zeppenfeld opened this issue Nov 10, 2023 · 2 comments · Fixed by #83037

Comments

@j-zeppenfeld
Copy link

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.

@akien-mga
Copy link
Member

I've noticed that too in 4.2-beta5.

@Calinou
Copy link
Member

Calinou commented Nov 10, 2023

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

Successfully merging a pull request may close this issue.

3 participants