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] WIP: Nullable test cases.
- Loading branch information
Showing
10 changed files
with
12 additions
and
11 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
modules/gdscript/tests/scripts/analyzer/errors/nullable_access_operator_index.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,2 @@ | ||
GDTEST_ANALYZER_ERROR | ||
Potentially unsafe for nullable "foo.c?[0]" to call "begins_with()". | ||
Potentially unsafe for nullable "<not implemented>" to call "begins_with()". |
2 changes: 1 addition & 1 deletion
2
modules/gdscript/tests/scripts/analyzer/errors/nullable_access_operator_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,2 +1,2 @@ | ||
GDTEST_ANALYZER_ERROR | ||
Potentially unsafe for nullable "foo?.b" to call "banana()". | ||
Potentially unsafe for nullable "b" to call "banana()". |
2 changes: 1 addition & 1 deletion
2
modules/gdscript/tests/scripts/analyzer/errors/nullable_cast_attribute_access.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,2 @@ | ||
GDTEST_ANALYZER_ERROR | ||
Potentially unsafe to access nullable cast expression "nullable_instance as A?" with attribute "foo". | ||
Potentially unsafe to access nullable cast expression "<not implemented>" with attribute "foo". |
2 changes: 1 addition & 1 deletion
2
modules/gdscript/tests/scripts/analyzer/errors/nullable_cast_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,2 +1,2 @@ | ||
GDTEST_ANALYZER_ERROR | ||
Potentially unsafe for the nullable cast expression "nullable_string as String?" to call "begins_with()". | ||
Potentially unsafe for the nullable cast expression "<not implemented>" to call "begins_with()". |
2 changes: 1 addition & 1 deletion
2
modules/gdscript/tests/scripts/analyzer/errors/nullable_for_on_subscript.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,2 @@ | ||
GDTEST_ANALYZER_ERROR | ||
Potentially unsafe for the nullable expression "instance.arr" to be used in a for-loop. | ||
Potentially unsafe for the nullable expression "arr" to be used in a for-loop. |
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 |
---|---|---|
|
@@ -2,4 +2,5 @@ class A: | |
var b: String | ||
func test(): | ||
var a: A? = A.new() | ||
a?.b = "123" | ||
a?.b = "123" | ||
print(a?.b) |
4 changes: 2 additions & 2 deletions
4
...tests/scripts/analyzer/errors/nullable_forbid_assigment_with_nullable_access_operator.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,2 @@ | ||
GDTEST_ANALYZER_ERROR | ||
The left-hand side of an assignment expression may not contain a nullable access operator ("?."). | ||
GDTEST_OK | ||
123 |
2 changes: 1 addition & 1 deletion
2
modules/gdscript/tests/scripts/analyzer/errors/nullable_index_access_nested.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,2 @@ | ||
GDTEST_ANALYZER_ERROR | ||
Potentially unsafe to access nullable "foobar[0]" with attribute "bar". | ||
Potentially unsafe to access nullable "<not implemented>" with attribute "bar". |
2 changes: 1 addition & 1 deletion
2
modules/gdscript/tests/scripts/analyzer/errors/nullable_method_call_nested_index.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,2 @@ | ||
GDTEST_ANALYZER_ERROR | ||
Potentially unsafe for nullable "foo[0]" to call "hey()". | ||
Potentially unsafe for nullable "<not implemented>" to call "hey()". |
2 changes: 1 addition & 1 deletion
2
modules/gdscript/tests/scripts/analyzer/errors/nullable_subscript_as_index.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,2 @@ | ||
GDTEST_ANALYZER_ERROR | ||
Potentially unsafe for the nullable expression "a_instance.get_nullable_instance()?.index" to be used as an index. | ||
Potentially unsafe for the nullable expression "index" to be used as an index. |