feat: godot-engine-source-4.3-stable
This commit is contained in:
parent
c59a7dcade
commit
7125d019b5
11149 changed files with 5070401 additions and 0 deletions
|
|
@ -0,0 +1,8 @@
|
|||
var weakling = 'not float'
|
||||
func weak(x: float = weakling):
|
||||
print(x)
|
||||
print('typeof x is', typeof(x))
|
||||
|
||||
func test():
|
||||
print(typeof(weak()))
|
||||
print('not ok')
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
GDTEST_RUNTIME_ERROR
|
||||
>> SCRIPT ERROR
|
||||
>> on function: weak()
|
||||
>> runtime/errors/bad_conversion_for_default_parameter.gd
|
||||
>> 2
|
||||
>> Trying to assign value of type 'String' to a variable of type 'float'.
|
||||
0
|
||||
not ok
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
#debug-only
|
||||
func test():
|
||||
var node := Node.new()
|
||||
var inside_tree = node.is_inside_tree
|
||||
node.free()
|
||||
inside_tree.call()
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
GDTEST_RUNTIME_ERROR
|
||||
>> SCRIPT ERROR
|
||||
>> on function: test()
|
||||
>> runtime/errors/callable_call_after_free_object.gd
|
||||
>> 6
|
||||
>> Attempt to call function 'null::is_inside_tree (Callable)' on a null instance.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
func test():
|
||||
var node := Node.new()
|
||||
node.free()
|
||||
print(node as Node2D)
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
GDTEST_RUNTIME_ERROR
|
||||
>> SCRIPT ERROR
|
||||
>> on function: test()
|
||||
>> runtime/errors/cast_freed_object.gd
|
||||
>> 4
|
||||
>> Trying to cast a freed object.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
func test():
|
||||
var integer: Variant = 1
|
||||
@warning_ignore("unsafe_cast")
|
||||
print(integer as Array)
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
GDTEST_RUNTIME_ERROR
|
||||
>> SCRIPT ERROR
|
||||
>> on function: test()
|
||||
>> runtime/errors/cast_int_to_array.gd
|
||||
>> 4
|
||||
>> Invalid cast: could not convert value to 'Array'.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
func test():
|
||||
var integer: Variant = 1
|
||||
@warning_ignore("unsafe_cast")
|
||||
print(integer as Node)
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
GDTEST_RUNTIME_ERROR
|
||||
>> SCRIPT ERROR
|
||||
>> on function: test()
|
||||
>> runtime/errors/cast_int_to_object.gd
|
||||
>> 4
|
||||
>> Invalid cast: can't convert a non-object value to an object type.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
func test():
|
||||
var object: Variant = RefCounted.new()
|
||||
@warning_ignore("unsafe_cast")
|
||||
print(object as int)
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
GDTEST_RUNTIME_ERROR
|
||||
>> SCRIPT ERROR
|
||||
>> on function: test()
|
||||
>> runtime/errors/cast_object_to_int.gd
|
||||
>> 4
|
||||
>> Invalid cast: could not convert value to 'int'.
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
const array: Array = [{}]
|
||||
|
||||
func test():
|
||||
var dictionary := array[0]
|
||||
var key: int = 0
|
||||
dictionary[key] = 0
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
GDTEST_RUNTIME_ERROR
|
||||
>> SCRIPT ERROR
|
||||
>> on function: test()
|
||||
>> runtime/errors/constant_array_is_deep.gd
|
||||
>> 6
|
||||
>> Invalid assignment on read-only value (on base: 'Dictionary').
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
const dictionary := {0: [0]}
|
||||
|
||||
func test():
|
||||
var array := dictionary[0]
|
||||
var key: int = 0
|
||||
array[key] = 0
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
GDTEST_RUNTIME_ERROR
|
||||
>> SCRIPT ERROR
|
||||
>> on function: test()
|
||||
>> runtime/errors/constant_dictionary_is_deep.gd
|
||||
>> 6
|
||||
>> Invalid assignment on read-only value (on base: 'Array').
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
func test():
|
||||
var a: Array = [Resource.new()]
|
||||
for node: Node in a:
|
||||
print(node)
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
GDTEST_RUNTIME_ERROR
|
||||
>> SCRIPT ERROR
|
||||
>> on function: test()
|
||||
>> runtime/errors/for_loop_iterator_type_not_match_specified.gd
|
||||
>> 3
|
||||
>> Trying to assign value of type 'Resource' to a variable of type 'Node'.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
func test():
|
||||
var x = Color()
|
||||
print(len(x)) # GDScript utility function.
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
GDTEST_RUNTIME_ERROR
|
||||
>> SCRIPT ERROR
|
||||
>> on function: test()
|
||||
>> runtime/errors/gd_utility_function_wrong_arg.gd
|
||||
>> 3
|
||||
>> Error calling GDScript utility function "len()": Value of type 'Color' can't provide a length.
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
# https://github.com/godotengine/godot/issues/90086
|
||||
|
||||
class MyObj:
|
||||
var obj: WeakRef
|
||||
|
||||
func test():
|
||||
var obj_1 = MyObj.new()
|
||||
var obj_2 = MyObj.new()
|
||||
obj_1.obj = obj_2
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
GDTEST_RUNTIME_ERROR
|
||||
>> SCRIPT ERROR
|
||||
>> on function: test()
|
||||
>> runtime/errors/invalid_property_assignment.gd
|
||||
>> 9
|
||||
>> Invalid assignment of property or key 'obj' with value of type 'RefCounted (MyObj)' on a base object of type 'RefCounted (MyObj)'.
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# https://github.com/godotengine/godot/issues/66675
|
||||
func test():
|
||||
example(Node2D)
|
||||
|
||||
func example(thing):
|
||||
print(thing.has_method('asdf'))
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
GDTEST_RUNTIME_ERROR
|
||||
>> SCRIPT ERROR
|
||||
>> on function: example()
|
||||
>> runtime/errors/non_static_method_call_on_native_class.gd
|
||||
>> 6
|
||||
>> Invalid call. Nonexistent function 'has_method' in base 'Node2D'.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
func test():
|
||||
var dictionary := { "a": 0 }
|
||||
dictionary.make_read_only()
|
||||
dictionary.a = 1
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
GDTEST_RUNTIME_ERROR
|
||||
>> SCRIPT ERROR
|
||||
>> on function: test()
|
||||
>> runtime/errors/read_only_dictionary.gd
|
||||
>> 4
|
||||
>> Invalid assignment on read-only value (on base: 'Dictionary').
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
func test():
|
||||
var basic := [1]
|
||||
var typed: Array[int] = basic
|
||||
print('not ok')
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
GDTEST_RUNTIME_ERROR
|
||||
>> SCRIPT ERROR
|
||||
>> on function: test()
|
||||
>> runtime/errors/typed_array_assign_basic_to_typed.gd
|
||||
>> 3
|
||||
>> Trying to assign an array of type "Array" to a variable of type "Array[int]".
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
func test():
|
||||
var differently: Variant = [1.0] as Array[float]
|
||||
var typed: Array[int] = differently
|
||||
print('not ok')
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
GDTEST_RUNTIME_ERROR
|
||||
>> SCRIPT ERROR
|
||||
>> on function: test()
|
||||
>> runtime/errors/typed_array_assign_differently_typed.gd
|
||||
>> 3
|
||||
>> Trying to assign an array of type "Array[float]" to a variable of type "Array[int]".
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
class Foo: pass
|
||||
class Bar extends Foo: pass
|
||||
class Baz extends Foo: pass
|
||||
|
||||
func test():
|
||||
var typed: Array[Bar] = [Baz.new() as Foo]
|
||||
print('not ok')
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
GDTEST_RUNTIME_ERROR
|
||||
>> ERROR
|
||||
>> Method/function failed.
|
||||
>> Unable to convert array index 0 from "Object" to "Object".
|
||||
not ok
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
func expect_typed(typed: Array[int]):
|
||||
print(typed.size())
|
||||
|
||||
func test():
|
||||
var basic := [1]
|
||||
expect_typed(basic)
|
||||
print('not ok')
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
GDTEST_RUNTIME_ERROR
|
||||
>> SCRIPT ERROR
|
||||
>> on function: test()
|
||||
>> runtime/errors/typed_array_pass_basic_to_typed.gd
|
||||
>> 6
|
||||
>> Invalid type in function 'expect_typed' in base 'RefCounted (typed_array_pass_basic_to_typed.gd)'. The array of argument 1 (Array) does not have the same element type as the expected typed array argument.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
func expect_typed(typed: Array[int]):
|
||||
print(typed.size())
|
||||
|
||||
func test():
|
||||
var differently: Variant = [1.0] as Array[float]
|
||||
expect_typed(differently)
|
||||
print('not ok')
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
GDTEST_RUNTIME_ERROR
|
||||
>> SCRIPT ERROR
|
||||
>> on function: test()
|
||||
>> runtime/errors/typed_array_pass_differently_to_typed.gd
|
||||
>> 6
|
||||
>> Invalid type in function 'expect_typed' in base 'RefCounted (typed_array_pass_differently_to_typed.gd)'. The array of argument 1 (Array[float]) does not have the same element type as the expected typed array argument.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
func test():
|
||||
var obj
|
||||
obj = Node.new()
|
||||
print(obj.free())
|
||||
|
|
@ -0,0 +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"
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
func test():
|
||||
var value
|
||||
value = []
|
||||
print(value.reverse())
|
||||
|
|
@ -0,0 +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"
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
func test():
|
||||
var obj
|
||||
obj = RefCounted.new()
|
||||
print(obj.notify_property_list_changed())
|
||||
|
|
@ -0,0 +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"
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
func test():
|
||||
var x = Color()
|
||||
print(floor(x)) # Built-in utility function.
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
GDTEST_RUNTIME_ERROR
|
||||
>> SCRIPT ERROR
|
||||
>> on function: test()
|
||||
>> runtime/errors/utility_function_wrong_arg.gd
|
||||
>> 3
|
||||
>> Error calling utility function "floor()": Argument "x" must be "int", "float", "Vector2", "Vector2i", "Vector3", "Vector3i", "Vector4", or "Vector4i".
|
||||
Loading…
Add table
Add a link
Reference in a new issue