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

GDScript bug (please report): Invalid value of lambda capture at index 0 #93990

Closed
mizuto opened this issue Jul 6, 2024 · 4 comments · Fixed by #94025
Closed

GDScript bug (please report): Invalid value of lambda capture at index 0 #93990

mizuto opened this issue Jul 6, 2024 · 4 comments · Fixed by #94025

Comments

@mizuto
Copy link

mizuto commented Jul 6, 2024

Tested versions

4.2.1

System information

Windows 10

Issue description

I have several lambdas that produces the following error during runtime:
GDScript bug (please report): Invalid value of lambda capture at index

Minimal reproduction project (MRP)

Bug.zip

Note: I was able to fix this by removing the "[String] " in the method signature.

@AThousandShips
Copy link
Member

Can you please try with 4.2.2 to make sure this hasn't already been fixed

@dalexeev
Copy link
Member

dalexeev commented Jul 6, 2024

 buff_func.callv([null, -1, null])

You are calling a one argument function with three arguments. I couldn't reproduce the bug with the provided snippet, please add more details.

func create_function(tokens: Array[String]):
    var buff_func = func do_stuff(entity: Object) -> void:
        prints(tokens, entity)
    buff_func.callv([null, -1, null])

func _ready() -> void:
    create_function([""])

By the way, the error is not displayed with callv, only with call (i.e. buff_func.call(null, -1, null)):

@AThousandShips AThousandShips removed the bug label Jul 6, 2024
@mizuto
Copy link
Author

mizuto commented Jul 6, 2024

Bug.zip
Sorry about that. I went and created a new project with this bug. The project produces the bug locally

02975b87d29a7c20cef101b1f7008503

@mizuto
Copy link
Author

mizuto commented Jul 6, 2024

Tried it with 4.2.2, same result.

@dalexeev dalexeev added bug and removed needs testing labels Jul 7, 2024
@dalexeev dalexeev added this to the 4.3 milestone Jul 7, 2024
@dalexeev dalexeev moved this from For team assessment to Fix pending review in GDScript Issue Triage Jul 7, 2024
@github-project-automation github-project-automation bot moved this from Fix pending review to Done in GDScript Issue Triage Jul 9, 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