godot/modules/gdscript/tests/scripts/parser/features/lambda_capture_callable.gd

5 lines
92 B
GDScript

func test():
var x = 42
var my_lambda = func(): print(x)
my_lambda.call() # Prints "42".