forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Nullable] Allow the configuration of the detection of assigning the …
…result of a function that returns void to a variable.
- Loading branch information
Showing
16 changed files
with
98 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletions
8
modules/gdscript/tests/scripts/analyzer/errors/use_value_of_void_function_builtin_method.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
GDTEST_ANALYZER_ERROR | ||
Cannot get return value of call to "reverse()" because it returns "void". | ||
GDTEST_OK | ||
>> WARNING | ||
>> Line: 3 | ||
>> RETURN_VALUE_VOID | ||
>> Cannot get return value of call to "reverse()" because it returns "void". | ||
<null> |
8 changes: 6 additions & 2 deletions
8
modules/gdscript/tests/scripts/analyzer/errors/use_value_of_void_function_custom_method.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
GDTEST_ANALYZER_ERROR | ||
Cannot get return value of call to "foo()" because it returns "void". | ||
GDTEST_OK | ||
>> WARNING | ||
>> Line: 5 | ||
>> RETURN_VALUE_VOID | ||
>> Cannot get return value of call to "foo()" because it returns "void". | ||
<null> |
9 changes: 7 additions & 2 deletions
9
modules/gdscript/tests/scripts/analyzer/errors/use_value_of_void_function_gd_utility.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
GDTEST_ANALYZER_ERROR | ||
Cannot get return value of call to "print_debug()" because it returns "void". | ||
GDTEST_OK | ||
>> WARNING | ||
>> Line: 2 | ||
>> RETURN_VALUE_VOID | ||
>> Cannot get return value of call to "print_debug()" because it returns "void". | ||
|
||
<null> |
8 changes: 6 additions & 2 deletions
8
modules/gdscript/tests/scripts/analyzer/errors/use_value_of_void_function_native_method.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
GDTEST_ANALYZER_ERROR | ||
Cannot get return value of call to "free()" because it returns "void". | ||
GDTEST_OK | ||
>> WARNING | ||
>> Line: 3 | ||
>> RETURN_VALUE_VOID | ||
>> Cannot get return value of call to "free()" because it returns "void". | ||
<null> |
9 changes: 7 additions & 2 deletions
9
modules/gdscript/tests/scripts/analyzer/errors/use_value_of_void_function_utility.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
GDTEST_ANALYZER_ERROR | ||
Cannot get return value of call to "print()" because it returns "void". | ||
GDTEST_OK | ||
>> WARNING | ||
>> Line: 2 | ||
>> RETURN_VALUE_VOID | ||
>> Cannot get return value of call to "print()" because it returns "void". | ||
|
||
<null> |
3 changes: 1 addition & 2 deletions
3
modules/gdscript/tests/scripts/runtime/errors/use_return_value_of_free_call.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
func test(): | ||
var obj | ||
obj = Node.new() | ||
var obj := Node.new() | ||
print(obj.free()) |
12 changes: 6 additions & 6 deletions
12
modules/gdscript/tests/scripts/runtime/errors/use_return_value_of_free_call.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
GDTEST_RUNTIME_ERROR | ||
>> SCRIPT ERROR | ||
>> on function: test() | ||
>> runtime/errors/use_return_value_of_free_call.gd | ||
>> 4 | ||
>> Trying to get a return value of a method that returns "void" | ||
GDTEST_OK | ||
>> WARNING | ||
>> Line: 3 | ||
>> RETURN_VALUE_VOID | ||
>> Cannot get return value of call to "free()" because it returns "void". | ||
<null> |
3 changes: 1 addition & 2 deletions
3
...les/gdscript/tests/scripts/runtime/errors/use_return_value_of_void_builtin_method_call.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
func test(): | ||
var value | ||
value = [] | ||
var value := [] | ||
print(value.reverse()) |
12 changes: 6 additions & 6 deletions
12
...es/gdscript/tests/scripts/runtime/errors/use_return_value_of_void_builtin_method_call.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
GDTEST_RUNTIME_ERROR | ||
>> SCRIPT ERROR | ||
>> on function: test() | ||
>> runtime/errors/use_return_value_of_void_builtin_method_call.gd | ||
>> 4 | ||
>> Trying to get a return value of a method that returns "void" | ||
GDTEST_OK | ||
>> WARNING | ||
>> Line: 3 | ||
>> RETURN_VALUE_VOID | ||
>> Cannot get return value of call to "reverse()" because it returns "void". | ||
<null> |
3 changes: 1 addition & 2 deletions
3
modules/gdscript/tests/scripts/runtime/errors/use_return_value_of_void_native_method_call.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
func test(): | ||
var obj | ||
obj = RefCounted.new() | ||
var obj := RefCounted.new() | ||
print(obj.notify_property_list_changed()) |
12 changes: 6 additions & 6 deletions
12
...les/gdscript/tests/scripts/runtime/errors/use_return_value_of_void_native_method_call.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
GDTEST_RUNTIME_ERROR | ||
>> SCRIPT ERROR | ||
>> on function: test() | ||
>> runtime/errors/use_return_value_of_void_native_method_call.gd | ||
>> 4 | ||
>> Trying to get a return value of a method that returns "void" | ||
GDTEST_OK | ||
>> WARNING | ||
>> Line: 3 | ||
>> RETURN_VALUE_VOID | ||
>> Cannot get return value of call to "notify_property_list_changed()" because it returns "void". | ||
<null> |