mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Merge pull request #70656 from vonagam/fix-void-returns
GDScript: Disallow return with value in void functions
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
func test() -> void:
|
||||
return null
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
A void function cannot return a value.
|
||||
@@ -0,0 +1,4 @@
|
||||
func test() -> void:
|
||||
var a
|
||||
a = 1
|
||||
return a
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
A void function cannot return a value.
|
||||
Reference in New Issue
Block a user