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

"unsafe call argument" GDScript warning shows up with safe argument #82529

Closed
mieldepoche opened this issue Sep 29, 2023 · 0 comments · Fixed by #82547
Closed

"unsafe call argument" GDScript warning shows up with safe argument #82529

mieldepoche opened this issue Sep 29, 2023 · 0 comments · Fixed by #82547

Comments

@mieldepoche
Copy link
Contributor

Godot version

4.2.dev fbe611e

System information

linux

Issue description

image

Providing an instance of a superseding class as an argument triggers this error.
For example, a version of Callable.new expects an Object, and will complain if it's given a Node instead of an primitive Object.

Steps to reproduce

  1. enable the warning or error in the project settings (debug/gdscript/warnings/unsafe_call_argument)

  2. put this script in a file:

extends Node
class_name MyNode

func _run() -> void:
    Callable(self, "")
  1. Line 5: The argument 1 of the function "Callable()" requires the subtype "Object" but the supertype "MyNode" was provided. (Warning treated as error.)

Minimal reproduction project

mrp_bad_gdscript_error.zip

@mieldepoche mieldepoche changed the title "unsafe call argument" GDScript warning shows up with safe call argument "unsafe call argument" GDScript warning shows up with safe argument Sep 29, 2023
@akien-mga akien-mga added this to the 4.2 milestone Oct 3, 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