GDScript: Fix UNSAFE_CAST warning

This commit is contained in:
Danil Alexeev
2023-10-27 11:08:54 +03:00
parent 09946f79bd
commit 6e996a597f
22 changed files with 150 additions and 6 deletions
@@ -0,0 +1,3 @@
func test():
var integer := 1
print(integer as Array)
@@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Invalid cast. Cannot convert from "int" to "Array".
@@ -0,0 +1,3 @@
func test():
var integer := 1
print(integer as Node)
@@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Invalid cast. Cannot convert from "int" to "Node".
@@ -0,0 +1,3 @@
func test():
var object := RefCounted.new()
print(object as int)
@@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Invalid cast. Cannot convert from "RefCounted" to "int".