mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
GDScript: Make using return of void function an error
Remove the `VOID_ASSIGNMENT` warning since those cases will be errors now.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
func test():
|
||||
var builtin := []
|
||||
print(builtin.reverse()) # Built-in type method.
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Cannot get return value of call to "reverse()" because it returns "void".
|
||||
@@ -0,0 +1,5 @@
|
||||
func foo() -> void:
|
||||
pass
|
||||
|
||||
func test():
|
||||
print(foo()) # Custom method.
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Cannot get return value of call to "foo()" because it returns "void".
|
||||
@@ -0,0 +1,2 @@
|
||||
func test():
|
||||
print(print_debug()) # GDScript utility function.
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Cannot get return value of call to "print_debug()" because it returns "void".
|
||||
@@ -0,0 +1,3 @@
|
||||
func test():
|
||||
var obj := Node.new()
|
||||
print(obj.free()) # Native type method.
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Cannot get return value of call to "free()" because it returns "void".
|
||||
@@ -0,0 +1,2 @@
|
||||
func test():
|
||||
print(print()) # Built-in utility function.
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_ANALYZER_ERROR
|
||||
Cannot get return value of call to "print()" because it returns "void".
|
||||
Reference in New Issue
Block a user