feat: updated godot version

This commit is contained in:
Sara Gerretsen 2026-04-04 19:38:56 +02:00
parent 0c508b0831
commit 42b028dbb5
4694 changed files with 236470 additions and 401376 deletions

View file

@ -1,18 +0,0 @@
class A:
func return_variant() -> Variant: return null
func return_void() -> void: pass
func return_int() -> int: return 123
func return_int_array(_string_array: Array[String]) -> Array[int]: return []
func return_int_dict(_string_dict: Dictionary[String, String]) -> Dictionary[int, int]: return {}
func return_node(_resource: Resource) -> Node: return null
class B extends A:
func return_variant(): pass
func return_void(): return 1
func return_int(): return "abc"
func return_int_array(string_array: Array[String]): return string_array
func return_int_dict(string_dict: Dictionary[String, String]): return string_dict
func return_node(resource: Resource): return resource
func test():
pass

View file

@ -1,8 +0,0 @@
GDTEST_ANALYZER_ERROR
>> ERROR at line 10: Not all code paths return a value.
>> ERROR at line 11: A void function cannot return a value.
>> ERROR at line 12: Cannot return a value of type "String" as "int".
>> ERROR at line 12: Cannot return value of type "String" because the function return type is "int".
>> ERROR at line 13: Cannot return value of type "Array[String]" because the function return type is "Array[int]".
>> ERROR at line 14: Cannot return value of type "Dictionary[String, String]" because the function return type is "Dictionary[int, int]".
>> ERROR at line 15: Cannot return value of type "Resource" because the function return type is "Node".

View file

@ -1,69 +0,0 @@
const UNTYPED_ARRAY: Variant = [1000]
const TYPED_ARRAY: Variant = [2000] as Array[int]
const UNTYPED_DICT: Variant = {1000: 1000}
const TYPED_DICT: Variant = {2000: 2000} as Dictionary[int, int]
const TEST_STRING_INDEX = "data"[0]
const TEST_VECTOR2_ATTR = Vector2(1, 2).x
const TEST_ARRAY_INDEX = [100, 200][0]
const TEST_DICT_ATTR = {a = 1, b = 2}.a
const TEST_CALL_ARRAY = Array()
const TEST_CALL_DICT = Dictionary()
const TEST_BINARY_OP = [1] + [2]
const TEST_TERNARY_OP = [123] if [true] else [456]
const TEST_CAST_UNTYPED_ARRAY = [11] as Array
const TEST_CAST_TYPED_ARRAY = [22] as Array[int]
const TEST_CAST_UNTYPED_DICT = {11: 111} as Dictionary
const TEST_CAST_TYPED_DICT = {22: 222} as Dictionary[int, int]
const TEST_TYPE_TEST_LITERAL_UNTYPED_ARRAY = [33] is Array
const TEST_TYPE_TEST_LITERAL_TYPED_ARRAY = [44] is Array[int]
const TEST_TYPE_TEST_LITERAL_UNTYPED_DICT = {33: 333} is Dictionary
const TEST_TYPE_TEST_LITERAL_TYPED_DICT = {44: 444} is Dictionary[int, int]
const TEST_TYPE_TEST_UNTYPED_UNTYPED_ARRAY = UNTYPED_ARRAY is Array
const TEST_TYPE_TEST_UNTYPED_TYPED_ARRAY = UNTYPED_ARRAY is Array[int]
const TEST_TYPE_TEST_UNTYPED_UNTYPED_DICT = UNTYPED_DICT is Dictionary
const TEST_TYPE_TEST_UNTYPED_TYPED_DICT = UNTYPED_DICT is Dictionary[int, int]
const TEST_TYPE_TEST_TYPED_UNTYPED_ARRAY = TYPED_ARRAY is Array
const TEST_TYPE_TEST_TYPED_TYPED_ARRAY = TYPED_ARRAY is Array[int]
const TEST_TYPE_TEST_TYPED_UNTYPED_DICT = TYPED_DICT is Dictionary
const TEST_TYPE_TEST_TYPED_TYPED_DICT = TYPED_DICT is Dictionary[int, int]
@export_custom(
PROPERTY_HINT_TYPE_STRING,
"%d/%d:Zero,One,Two" % [TYPE_INT, PROPERTY_HINT_ENUM],
)
var test_export_custom: Array
func test():
var script: Script = get_script()
var constants: Dictionary = script.get_script_constant_map()
for constant: StringName in constants:
if constant.begins_with("TEST_"):
print("const %s = %s" % [constant, var_to_str(constants[constant]).replace("\n", "")])
if constants[constant] is Array:
var array: Array = constants[constant]
Utils.check(array.is_read_only())
array = get(constant)
Utils.check(array.is_read_only())
elif constants[constant] is Dictionary:
var dict: Dictionary = constants[constant]
Utils.check(dict.is_read_only())
dict = get(constant)
Utils.check(dict.is_read_only())
for property in get_property_list():
if str(property.name).begins_with("test_"):
Utils.print_property_extended_info(property, self)
# GH-96152
const ARRAY = [42]
const CONST_CONCAT = ARRAY + ARRAY
var var_concat := ARRAY + ARRAY
prints(CONST_CONCAT, CONST_CONCAT.is_read_only())
prints(var_concat, var_concat.is_read_only())

View file

@ -1,29 +0,0 @@
GDTEST_OK
const TEST_STRING_INDEX = "d"
const TEST_VECTOR2_ATTR = 1.0
const TEST_ARRAY_INDEX = 100
const TEST_DICT_ATTR = 1
const TEST_CALL_ARRAY = []
const TEST_CALL_DICT = {}
const TEST_BINARY_OP = [1, 2]
const TEST_TERNARY_OP = [123]
const TEST_CAST_UNTYPED_ARRAY = [11]
const TEST_CAST_TYPED_ARRAY = Array[int]([22])
const TEST_CAST_UNTYPED_DICT = {11: 111}
const TEST_CAST_TYPED_DICT = Dictionary[int, int]({22: 222})
const TEST_TYPE_TEST_LITERAL_UNTYPED_ARRAY = true
const TEST_TYPE_TEST_LITERAL_TYPED_ARRAY = false
const TEST_TYPE_TEST_LITERAL_UNTYPED_DICT = true
const TEST_TYPE_TEST_LITERAL_TYPED_DICT = false
const TEST_TYPE_TEST_UNTYPED_UNTYPED_ARRAY = true
const TEST_TYPE_TEST_UNTYPED_TYPED_ARRAY = false
const TEST_TYPE_TEST_UNTYPED_UNTYPED_DICT = true
const TEST_TYPE_TEST_UNTYPED_TYPED_DICT = false
const TEST_TYPE_TEST_TYPED_UNTYPED_ARRAY = true
const TEST_TYPE_TEST_TYPED_TYPED_ARRAY = true
const TEST_TYPE_TEST_TYPED_UNTYPED_DICT = true
const TEST_TYPE_TEST_TYPED_TYPED_DICT = true
var test_export_custom: Array = []
hint=TYPE_STRING hint_string="<int>/<ENUM>:Zero,One,Two" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
[42, 42] true
[42, 42] false

View file

@ -24,9 +24,9 @@ class B extends A:
func untyped_to_node() -> Node: return null
func void_to_untyped(): pass
func variant_to_untyped(): return null
func int_to_untyped(): return 0
func node_to_untyped(): return null
func variant_to_untyped(): pass
func int_to_untyped(): pass
func node_to_untyped(): pass
func test():
pass

View file

@ -19,24 +19,6 @@ func test():
Utils.check((const_builtin is float) == false)
Utils.check(is_instance_of(const_builtin, TYPE_FLOAT) == false)
var untyped_array: Variant = []
Utils.check((untyped_array is Variant) == true)
Utils.check((untyped_array is Array) == true)
Utils.check(is_instance_of(untyped_array, TYPE_ARRAY) == true)
Utils.check((untyped_array is Array[int]) == false)
Utils.check((untyped_array is Array[float]) == false)
Utils.check((untyped_array is int) == false)
Utils.check(is_instance_of(untyped_array, TYPE_INT) == false)
const const_untyped_array: Variant = []
Utils.check((const_untyped_array is Variant) == true)
Utils.check((const_untyped_array is Array) == true)
Utils.check(is_instance_of(const_untyped_array, TYPE_ARRAY) == true)
Utils.check((const_untyped_array is Array[int]) == false)
Utils.check((const_untyped_array is Array[float]) == false)
Utils.check((const_untyped_array is int) == false)
Utils.check(is_instance_of(const_untyped_array, TYPE_INT) == false)
var int_array: Variant = [] as Array[int]
Utils.check((int_array is Variant) == true)
Utils.check((int_array is Array) == true)
@ -46,7 +28,7 @@ func test():
Utils.check((int_array is int) == false)
Utils.check(is_instance_of(int_array, TYPE_INT) == false)
const const_int_array: Variant = [] as Array[int]
var const_int_array: Variant = [] as Array[int]
Utils.check((const_int_array is Variant) == true)
Utils.check((const_int_array is Array) == true)
Utils.check(is_instance_of(const_int_array, TYPE_ARRAY) == true)
@ -65,7 +47,7 @@ func test():
Utils.check((b_array is int) == false)
Utils.check(is_instance_of(b_array, TYPE_INT) == false)
const const_b_array: Variant = [] as Array[B]
var const_b_array: Variant = [] as Array[B]
Utils.check((const_b_array is Variant) == true)
Utils.check((const_b_array is Array) == true)
Utils.check(is_instance_of(const_b_array, TYPE_ARRAY) == true)

View file

@ -1,43 +0,0 @@
class A:
func return_float() -> float: return 1.0
func return_int_as_float(_x: int) -> float: return 1.0
func return_variant_as_float(_x: Variant) -> float: return 1.0
func return_float_array() -> Array[float]: return [1.0]
func return_untyped_array_as_float_array(_array: Array) -> Array[float]: return [1.0]
func return_float_dict() -> Dictionary[float, float]: return {1.0: 1.0}
func return_untyped_dict_as_float_dict(_dict: Dictionary) -> Dictionary[float, float]: return {1.0: 1.0}
func return_object_as_node(_object: Object) -> Node: return null
class B extends A:
func return_float(): return 2
func return_int_as_float(x: int): return x
func return_variant_as_float(x: Variant): return x
func return_float_array(): return [2]
func return_untyped_array_as_float_array(array: Array): return array
func return_float_dict(): return {2: 2}
func return_untyped_dict_as_float_dict(dict: Dictionary): return dict
func return_object_as_node(object: Object): return object
func output(value: Variant) -> void:
if value is Object:
var object: Object = value
print("<%s>" % object.get_class())
else:
print(var_to_str(value).replace("\n", ""))
func test():
var b := B.new()
var float_array: Array[float] = [2]
var float_dict: Dictionary[float, float] = {2: 2}
var node := Node.new()
output(b.return_float())
output(b.return_int_as_float(2))
output(b.return_variant_as_float(2))
output(b.return_float_array())
output(b.return_untyped_array_as_float_array(float_array))
output(b.return_float_dict())
output(b.return_untyped_dict_as_float_dict(float_dict))
output(b.return_object_as_node(node))
node.free()

View file

@ -1,9 +0,0 @@
GDTEST_OK
2.0
2.0
2.0
Array[float]([2.0])
Array[float]([2.0])
Dictionary[float, float]({2.0: 2.0})
Dictionary[float, float]({2.0: 2.0})
<Node>

View file

@ -1,6 +1,6 @@
class BaseClass:
func _get_property_list():
return [{"property" : "definition"}]
return {"property" : "definition"}
class SuperClassMethodsRecognized extends BaseClass:
func _init():
@ -11,7 +11,7 @@ class SuperMethodsRecognized extends BaseClass:
func _get_property_list():
# Recognizes super method.
var result = super()
result[0]["new"] = "new"
result["new"] = "new"
return result
func test():

View file

@ -1,3 +1,3 @@
GDTEST_OK
[{ "property": "definition" }]
[{ "property": "definition", "new": "new" }]
{ "property": "definition" }
{ "property": "definition", "new": "new" }

View file

@ -149,7 +149,7 @@ func test_unsafe_void_return() -> void:
@warning_ignore("native_method_override")
func get_class():
return ""
pass
# We don't want to execute it because of errors, just analyze.
func test():

View file

@ -5,8 +5,6 @@ extends Node
const PreloadedGlobalClass = preload("./export_variable_global.notest.gd")
const PreloadedUnnamedClass = preload("./export_variable_unnamed.notest.gd")
enum CustomEnum {A, B, C}
# Built-in types.
@export var test_weak_int = 1
@export var test_hard_int: int = 2
@ -18,21 +16,8 @@ enum CustomEnum {A, B, C}
@export_node_path("Sprite2D", "Sprite3D", "Control", "Node") var test_node_path := ^"hello"
# Enums.
@export var test_side_weak = SIDE_LEFT
@export var test_atm_weak = AUTO_TRANSLATE_MODE_INHERIT
@export var test_custom_enum_weak = CustomEnum.A
@export var test_side_hard: Side
@export var test_atm_hard: AutoTranslateMode
@export var test_custom_enum_hard: CustomEnum
var test_side_weak_no_export = SIDE_LEFT
var test_atm_weak_no_export = AUTO_TRANSLATE_MODE_INHERIT
var test_custom_enum_weak_no_export = CustomEnum.A
var test_side_hard_no_export: Side
var test_atm_hard_no_export: AutoTranslateMode
var test_custom_enum_hard_no_export: CustomEnum
@export var test_side: Side
@export var test_atm: AutoTranslateMode
# Resources and nodes.
@export var test_image: Image

View file

@ -15,30 +15,10 @@ var test_color_no_alpha: Color = Color(0, 0, 0, 1)
hint=COLOR_NO_ALPHA hint_string="" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_node_path: NodePath = NodePath("hello")
hint=NODE_PATH_VALID_TYPES hint_string="Sprite2D,Sprite3D,Control,Node" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_side_weak: Side = 0
var test_side: Side = 0
hint=ENUM hint_string="Side Left:0,Side Top:1,Side Right:2,Side Bottom:3" usage=DEFAULT|SCRIPT_VARIABLE|CLASS_IS_ENUM class_name=&"Side"
var test_atm_weak: Node.AutoTranslateMode = 0
var test_atm: Node.AutoTranslateMode = 0
hint=ENUM hint_string="Auto Translate Mode Inherit:0,Auto Translate Mode Always:1,Auto Translate Mode Disabled:2" usage=DEFAULT|SCRIPT_VARIABLE|CLASS_IS_ENUM class_name=&"Node.AutoTranslateMode"
var test_custom_enum_weak: ExportVariableTest.CustomEnum = 0
hint=ENUM hint_string="A:0,B:1,C:2" usage=DEFAULT|SCRIPT_VARIABLE|CLASS_IS_ENUM class_name=&"ExportVariableTest.CustomEnum"
var test_side_hard: Side = 0
hint=ENUM hint_string="Side Left:0,Side Top:1,Side Right:2,Side Bottom:3" usage=DEFAULT|SCRIPT_VARIABLE|CLASS_IS_ENUM class_name=&"Side"
var test_atm_hard: Node.AutoTranslateMode = 0
hint=ENUM hint_string="Auto Translate Mode Inherit:0,Auto Translate Mode Always:1,Auto Translate Mode Disabled:2" usage=DEFAULT|SCRIPT_VARIABLE|CLASS_IS_ENUM class_name=&"Node.AutoTranslateMode"
var test_custom_enum_hard: ExportVariableTest.CustomEnum = 0
hint=ENUM hint_string="A:0,B:1,C:2" usage=DEFAULT|SCRIPT_VARIABLE|CLASS_IS_ENUM class_name=&"ExportVariableTest.CustomEnum"
var test_side_weak_no_export: Variant = 0
hint=ENUM hint_string="Side Left:0,Side Top:1,Side Right:2,Side Bottom:3" usage=SCRIPT_VARIABLE|NIL_IS_VARIANT class_name=&""
var test_atm_weak_no_export: Variant = 0
hint=ENUM hint_string="Auto Translate Mode Inherit:0,Auto Translate Mode Always:1,Auto Translate Mode Disabled:2" usage=SCRIPT_VARIABLE|NIL_IS_VARIANT class_name=&""
var test_custom_enum_weak_no_export: Variant = 0
hint=ENUM hint_string="A:0,B:1,C:2" usage=SCRIPT_VARIABLE|NIL_IS_VARIANT class_name=&""
var test_side_hard_no_export: Side = 0
hint=ENUM hint_string="Side Left:0,Side Top:1,Side Right:2,Side Bottom:3" usage=SCRIPT_VARIABLE|CLASS_IS_ENUM class_name=&"Side"
var test_atm_hard_no_export: Node.AutoTranslateMode = 0
hint=ENUM hint_string="Auto Translate Mode Inherit:0,Auto Translate Mode Always:1,Auto Translate Mode Disabled:2" usage=SCRIPT_VARIABLE|CLASS_IS_ENUM class_name=&"Node.AutoTranslateMode"
var test_custom_enum_hard_no_export: ExportVariableTest.CustomEnum = 0
hint=ENUM hint_string="A:0,B:1,C:2" usage=SCRIPT_VARIABLE|CLASS_IS_ENUM class_name=&"ExportVariableTest.CustomEnum"
var test_image: Image = null
hint=RESOURCE_TYPE hint_string="Image" usage=DEFAULT|SCRIPT_VARIABLE class_name=&"Image"
var test_timer: Timer = null

View file

@ -1,43 +0,0 @@
class A:
func return_int(_variant: Variant) -> int: return 123
func return_int_array(_variant: Variant) -> Array[int]: return [1]
func return_int_dict(_variant: Variant) -> Dictionary[int, int]: return {1: 1}
func return_node(_variant: Variant) -> Node: return null
class B extends A:
func return_int(variant: Variant): return variant
func return_int_array(variant: Variant): return variant
func return_int_dict(variant: Variant): return variant
func return_node(variant: Variant): return variant
func output(value: Variant) -> void:
if value is Object:
var object: Object = value
print("<%s>" % object.get_class())
else:
print(var_to_str(value).replace("\n", ""))
func test():
var b := B.new()
output(b.return_int("abc"))
output(b.return_int_array("abc"))
output(b.return_int_dict("abc"))
output(b.return_node("abc"))
var resource := Resource.new()
output(b.return_int(resource))
output(b.return_int_array(resource))
output(b.return_int_dict(resource))
output(b.return_node(resource))
var untyped_array: Array
var string_array: Array[String]
var untyped_dict: Dictionary
var string_dict: Dictionary[String, String]
output(b.return_int_array(untyped_array))
output(b.return_int_array(string_array))
output(b.return_int_dict(untyped_dict))
output(b.return_int_dict(string_dict))

View file

@ -1,25 +0,0 @@
GDTEST_RUNTIME_ERROR
>> SCRIPT ERROR at runtime/errors/untyped_override_return_incompatible_value.gd:8 on B.return_int(): Trying to return a value of type "String" from a function whose return type is "int".
0
>> SCRIPT ERROR at runtime/errors/untyped_override_return_incompatible_value.gd:9 on B.return_int_array(): Trying to return a value of type "String" from a function whose return type is "Array[int]".
Array[int]([])
>> SCRIPT ERROR at runtime/errors/untyped_override_return_incompatible_value.gd:10 on B.return_int_dict(): Trying to return a value of type "String" from a function whose return type is "Dictionary[int, int]".
Dictionary[int, int]({})
>> SCRIPT ERROR at runtime/errors/untyped_override_return_incompatible_value.gd:11 on B.return_node(): Trying to return a value of type "String" from a function whose return type is "Node".
null
>> SCRIPT ERROR at runtime/errors/untyped_override_return_incompatible_value.gd:8 on B.return_int(): Trying to return a value of type "Resource" from a function whose return type is "int".
0
>> SCRIPT ERROR at runtime/errors/untyped_override_return_incompatible_value.gd:9 on B.return_int_array(): Trying to return a value of type "Resource" from a function whose return type is "Array[int]".
Array[int]([])
>> SCRIPT ERROR at runtime/errors/untyped_override_return_incompatible_value.gd:10 on B.return_int_dict(): Trying to return a value of type "Resource" from a function whose return type is "Dictionary[int, int]".
Dictionary[int, int]({})
>> SCRIPT ERROR at runtime/errors/untyped_override_return_incompatible_value.gd:11 on B.return_node(): Trying to return a value of type "Resource" from a function whose return type is "Node".
null
>> SCRIPT ERROR at runtime/errors/untyped_override_return_incompatible_value.gd:9 on B.return_int_array(): Trying to return a value of type "Array" from a function whose return type is "Array[int]".
Array[int]([])
>> SCRIPT ERROR at runtime/errors/untyped_override_return_incompatible_value.gd:9 on B.return_int_array(): Trying to return a value of type "Array[String]" from a function whose return type is "Array[int]".
Array[int]([])
>> SCRIPT ERROR at runtime/errors/untyped_override_return_incompatible_value.gd:10 on B.return_int_dict(): Trying to return a value of type "Dictionary" from a function whose return type is "Dictionary[int, int]".
Dictionary[int, int]({})
>> SCRIPT ERROR at runtime/errors/untyped_override_return_incompatible_value.gd:10 on B.return_int_dict(): Trying to return a value of type "Dictionary[String, String]" from a function whose return type is "Dictionary[int, int]".
Dictionary[int, int]({})

View file

@ -1,9 +0,0 @@
class_name TestCallNativeStatic
extends JSON
func test():
var s: GDScript = get_script()
@warning_ignore("unsafe_method_access")
print(s.stringify("test"))
print(s.call(&"stringify", "test"))
print(TestCallNativeStatic.stringify("test"))

View file

@ -1,78 +0,0 @@
class Instance:
func _init() -> void:
print("Instance _init")
func _to_string() -> String:
return "<Instance>"
func _notification(what: int) -> void:
if what == NOTIFICATION_PREDELETE:
print("Instance predelete")
# GH-116706
class LocalOwner:
signal never_emitted()
func _init() -> void:
print("LocalOwner _init")
func _notification(what: int) -> void:
if what == NOTIFICATION_PREDELETE:
print("LocalOwner predelete")
func interrupted_coroutine() -> void:
print("interrupted_coroutine begin")
var _instance := Instance.new()
await never_emitted
print("interrupted_coroutine end")
func subtest_order():
print("subtest_order begin")
var local_owner := LocalOwner.new()
@warning_ignore("missing_await")
local_owner.interrupted_coroutine()
local_owner = null
print("subtest_order end")
# GH-117049
signal tick()
func await_before_and_after() -> void:
await tick
var packed_array: PackedStringArray = ["abc"]
var instance := Instance.new()
await tick
prints(packed_array, instance)
func await_two_after() -> void:
var packed_array: PackedStringArray = ["abc"]
var instance := Instance.new()
await tick
await tick
prints(packed_array, instance)
func subtest_resume():
print("subtest_resume begin")
@warning_ignore("missing_await")
await_before_and_after()
tick.emit()
tick.emit()
print("---")
@warning_ignore("missing_await")
await_two_after()
tick.emit()
tick.emit()
print("subtest_resume end")
# ===
func test():
subtest_order()
print("===")
subtest_resume()

View file

@ -1,18 +0,0 @@
GDTEST_OK
subtest_order begin
LocalOwner _init
interrupted_coroutine begin
Instance _init
LocalOwner predelete
Instance predelete
subtest_order end
===
subtest_resume begin
Instance _init
["abc"] <Instance>
Instance predelete
---
Instance _init
["abc"] <Instance>
Instance predelete
subtest_resume end

View file

@ -6,7 +6,7 @@ func test():
print(var_to_str(COLOR))
print(var_to_str(color))
var string := "A"
var string_name := &"A"
print(ord(string))
print(ord(string_name))
var string := "Node"
var string_name := &"Node"
print(type_exists(string))
print(type_exists(string_name))

View file

@ -1,5 +1,5 @@
GDTEST_OK
Color(1, 0, 0, 1)
Color(1, 0, 0, 1)
65
65
true
true

View file

@ -1,31 +0,0 @@
var a: Array = [1]:
set(v):
prints("set a", v)
a = v
get:
prints("get a")
return a
var b: PackedByteArray = [1]:
set(v):
prints("set b", v)
b = v
get:
prints("get b")
return b
var c: PackedVector2Array = [Vector2.ONE]:
set(v):
prints("set c", v)
c = v
get:
prints("get c")
return c
func test():
a[0] = 2
print(a)
b[0] = 2
print(b)
c[0].x = 2
print(c)

View file

@ -1,10 +0,0 @@
GDTEST_OK
get a
get a
[2]
get b
get b
[2]
get c
get c
[(2.0, 1.0)]

View file

@ -10,18 +10,19 @@ static func check(condition: Variant) -> void:
return
printerr("Check failed. Backtrace (most recent call first):")
var stack: Array = get_stack()
var dir: String
for i: int in stack.size():
var frame: Dictionary = stack[i]
if i == 0:
dir = str(frame.source).trim_suffix("utils.notest.gd")
else:
printerr(" %s:%d @ %s()" % [
str(frame.source).trim_prefix(dir),
frame.line,
frame.function,
])
for stack: ScriptBacktrace in Engine.capture_script_backtraces():
if stack.get_language_name() == "GDScript":
var dir: String
for i: int in stack.get_frame_count():
if i == 0:
dir = stack.get_frame_file(i).trim_suffix("utils.notest.gd")
else:
printerr(" %s:%d @ %s()" % [
stack.get_frame_file(i).trim_prefix(dir),
stack.get_frame_line(i),
stack.get_frame_function(i),
])
break
static func get_type(property: Dictionary, is_return: bool = false) -> String: