You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lambdas automatically allow you to bind and access variables in the parent context, I don't think this can be changed in a non-breaking way to allow you to both declare them and access them
@AThousandShips thank you, I know you can access variables from the parent scope, but this isn't a problem in any other language I have seen, they usually can bubble up the scope to the parent context if a variable is not found, similar to how you can access class variables from functions if they are not declared locally. Especially since lambda parameters can shadow parent scope variables just fine without problems:
Tested versions
Godot v4.3.stable - Windows 10.0.26100 - Vulkan (Forward+) - integrated Intel(R) Iris(R) Xe Graphics (Intel Corporation; 31.0.101.5595) - 13th Gen Intel(R) Core(TM) i5-1340P (16 Threads)
System information
N/A
Issue description
When creating a GDScript function containing a lambda in it, both with the same variable name, this will result in a compile error.
Steps to reproduce
Create the following script below. It will result in the following error:
Minimal reproduction project (MRP)
The text was updated successfully, but these errors were encountered: