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

Using @warning_ignore to ignore "shadowed_global_identifier" still issues warning(s) #75208

Closed
cobrapitz opened this issue Mar 22, 2023 · 1 comment · Fixed by #75620
Closed

Comments

@cobrapitz
Copy link

Godot version

Godot 4.0.1.stable

System information

Windows 10, Forward+

Issue description

Example code:

@warning_ignore("shadowed_global_identifier")
static func print_debug(msg: String):

the warning is ignored by pressing [ignore] in the warnings panel.

pressing it multiple times results in:

@warning_ignore("shadowed_global_identifier", "shadowed_global_identifier")

Steps to reproduce

Shadowing a global function with a method of script:

@warning_ignore("shadowed_global_identifier")
static func print_debug(msg: String):

Minimal reproduction project

@warning_ignore("shadowed_global_identifier")
static func print_debug(msg: String):
    pass
@jpcerrone
Copy link
Contributor

jpcerrone commented Mar 29, 2023

This issue seems to only be happening on the top level scope of a script.
These two top-level declarations show the warning in the panel:

@warning_ignore("shadowed_global_identifier")
func print_debug():
    pass
@warning_ignore("shadowed_global_identifier")
var print_debug

While the @warning_ignore("shadowed_global_identifier") annotation seems to work properly on a functions inner scope, like so:

func foo():
    @warning_ignore("shadowed_global_identifier")
    var print_debug

This last case doesn't show the warning in the panel when the annotation is applied.

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.

4 participants