modules/gdscript/tests/scripts/runtime/features/lambda_bind_argument_count.gd
raw| 1 | # https://github.com/godotengine/godot/issues/93952 |
| 2 | |
| 3 | func foo(): |
| 4 | pass |
| 5 | |
| 6 | func test(): |
| 7 | var a: int |
| 8 | |
| 9 | var lambda_self := func (x: int) -> void: |
| 10 | foo() |
| 11 | print(a, x) |
| 12 | |
| 13 | print(lambda_self.get_argument_count()) # Should print 1. |
| 14 | |
| 15 | var lambda_non_self := func (x: int) -> void: |
| 16 | print(a, x) |
| 17 | |
| 18 | print(lambda_non_self.get_argument_count()) # Should print 1. |