GDScript: Fix typing of lambda functions
This commit is contained in:
parent
b14f7aa9f9
commit
532ffc30bd
12 changed files with 65 additions and 26 deletions
|
|
@ -0,0 +1,4 @@
|
|||
func test():
|
||||
var lambda := func() -> int:
|
||||
print('no return')
|
||||
lambda.call()
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Not all code paths return a value.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
func test():
|
||||
var lambda := func() -> int:
|
||||
return 'string'
|
||||
print(lambda.call())
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cannot return value of type "String" because the function return type is "int".
|
||||
Loading…
Add table
Add a link
Reference in a new issue