GDScript: Fix typing of lambda functions

This commit is contained in:
Dmitrii Maganov 2022-12-28 07:41:03 +02:00
parent b14f7aa9f9
commit 532ffc30bd
12 changed files with 65 additions and 26 deletions

View file

@ -0,0 +1,4 @@
func test():
var lambda := func() -> int:
print('no return')
lambda.call()

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Not all code paths return a value.

View file

@ -0,0 +1,4 @@
func test():
var lambda := func() -> int:
return 'string'
print(lambda.call())

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Cannot return value of type "String" because the function return type is "int".