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

_init() arguments are not suggested when using new() #92245

Closed
daenvil opened this issue May 22, 2024 · 0 comments · Fixed by #92251
Closed

_init() arguments are not suggested when using new() #92245

daenvil opened this issue May 22, 2024 · 0 comments · Fixed by #92251

Comments

@daenvil
Copy link

daenvil commented May 22, 2024

Tested versions

v4.2.stable.official [46dc277]
v4.2.2.stable.official [15073af]

System information

Godot v4.2.stable - Windows 10.0.19045 - GLES3 (Compatibility) - NVIDIA GeForce GTX 1050 Ti (NVIDIA; 31.0.15.3699) - AMD Ryzen 5 2600 Six-Core Processor (12 Threads)

Issue description

I created the following script:

extends Resource
class_name Test

func _init(a: int, b: int) -> void:
	pass

func foo(a: int, b: int) -> void:
	pass

When initializing an object with this class using new(), the editor does not show the available arguments:
image

It does work, however, with other functions in the script:
image

Steps to reproduce

  1. Create a script class that inherits from Resource
  2. Add an _init() method with some arguments to that class
  3. Try to initialize the class anywhere

Minimal reproduction project (MRP)

mrp.zip

@akien-mga akien-mga changed the title _init() arguments are not suggested when using new() _init() arguments are not suggested when using new() May 22, 2024
@github-project-automation github-project-automation bot moved this to For team assessment in GDScript Issue Triage May 23, 2024
@dalexeev dalexeev moved this from For team assessment to Fix pending review in GDScript Issue Triage May 23, 2024
@github-project-automation github-project-automation bot moved this from Fix pending review to Done in GDScript Issue Triage May 30, 2024
@akien-mga akien-mga added this to the 4.3 milestone May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants