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,2 @@
|
|||
func test():
|
||||
InstancePlaceholder.new()
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Native class "InstancePlaceholder" cannot be constructed as it is abstract.
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
class A extends InstancePlaceholder:
|
||||
func _init():
|
||||
print('no')
|
||||
|
||||
class B extends A:
|
||||
pass
|
||||
|
||||
func test():
|
||||
B.new()
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Class "abstract_script_instantiate.gd::B" cannot be constructed as it is based on abstract native class "InstancePlaceholder".
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
var num := 1
|
||||
|
||||
@export_range(num, 10) var a
|
||||
|
||||
func test():
|
||||
pass
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Argument 1 of annotation "@export_range" isn't a constant expression.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
enum { V }
|
||||
func test():
|
||||
V = 1
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cannot assign a new value to a constant.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
enum NamedEnum { V }
|
||||
func test():
|
||||
NamedEnum.V = 1
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cannot assign a new value to a constant.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
signal your_base
|
||||
signal my_base
|
||||
func test():
|
||||
your_base = my_base
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cannot assign a new value to a constant.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
func test():
|
||||
var tree := SceneTree.new()
|
||||
tree.root = Window.new()
|
||||
tree.free()
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cannot assign a new value to a read-only property.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
func test():
|
||||
var state := PhysicsDirectBodyState3DExtension.new()
|
||||
state.center_of_mass.x += 1.0
|
||||
state.free()
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cannot assign a new value to a read-only property.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
func test():
|
||||
var var_color: String = Color.RED
|
||||
print('not ok')
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cannot assign a value of type "Color" as "String".
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
signal my_signal()
|
||||
|
||||
func test():
|
||||
var _a := await my_signal
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cannot infer the type of "_a" variable because the value doesn't have a set type.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
func test():
|
||||
# Error here.
|
||||
print(2.2 << 4)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Invalid operands to operator <<, float and int.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
func test():
|
||||
# Error here.
|
||||
print(2 >> 4.4)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Invalid operands to operator >>, int and float.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# GH-73283
|
||||
|
||||
class MyClass:
|
||||
pass
|
||||
|
||||
func test():
|
||||
MyClass.not_existing_method()
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Static function "not_existing_method()" not found in base "MyClass".
|
||||
|
|
@ -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".
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
class Vector2:
|
||||
pass
|
||||
|
||||
func test():
|
||||
pass
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Class "Vector2" hides a built-in type.
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
const array: Array = [0]
|
||||
|
||||
func test():
|
||||
var key: int = 0
|
||||
array[key] = 0
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cannot assign a new value to a constant.
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
const dictionary := {}
|
||||
|
||||
func test():
|
||||
var key: int = 0
|
||||
dictionary[key] = 0
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cannot assign a new value to a constant.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
const Vector2 = 0
|
||||
|
||||
func test():
|
||||
pass
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
The member "Vector2" cannot have the same name as a builtin type.
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
const base := [0]
|
||||
|
||||
func test():
|
||||
var sub := base[0]
|
||||
if sub is String: pass
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Expression is of type "int" so it can't be of type "String".
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
const CONSTANT = 25
|
||||
|
||||
|
||||
func test():
|
||||
CONSTANT(123)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Member "CONSTANT" is not a function.
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
class A:
|
||||
func _init():
|
||||
pass
|
||||
|
||||
class B extends A: pass
|
||||
class C extends A: pass
|
||||
|
||||
func test():
|
||||
var x := B.new()
|
||||
print(x is C)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Expression is of type "B" so it can't be of type "C".
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
func test():
|
||||
print(InnerA.new())
|
||||
|
||||
class InnerA extends InnerB:
|
||||
pass
|
||||
|
||||
class InnerB extends InnerA:
|
||||
pass
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cyclic inheritance.
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
func test():
|
||||
print(c1)
|
||||
|
||||
const c1 = c2
|
||||
const c2 = c1
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Could not resolve member "c1": Cyclic reference.
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
func test():
|
||||
print(E1.V)
|
||||
|
||||
enum E1 {V = E2.V}
|
||||
enum E2 {V = E1.V}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Could not resolve member "E1": Cyclic reference.
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
func test():
|
||||
print(EV1)
|
||||
|
||||
enum {EV1 = EV2}
|
||||
enum {EV2 = EV1}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Could not resolve member "EV1": Cyclic reference.
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
func test():
|
||||
print(v)
|
||||
|
||||
var v = A.v
|
||||
|
||||
const A = preload("cyclic_ref_external_a.notest.gd")
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Could not resolve external class member "v".
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
const B = preload("cyclic_ref_external.gd")
|
||||
|
||||
var v = B.v
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
func test():
|
||||
print(f1())
|
||||
print(f2())
|
||||
|
||||
static func f1(p := f2()) -> int:
|
||||
return 1
|
||||
|
||||
static func f2(p := f1()) -> int:
|
||||
return 2
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Could not resolve member "f1": Cyclic reference.
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
func test():
|
||||
print(v)
|
||||
|
||||
var v := InnerA.new().f()
|
||||
|
||||
class InnerA:
|
||||
func f(p := InnerB.new().f()) -> int:
|
||||
return 1
|
||||
|
||||
class InnerB extends InnerA:
|
||||
func f(p := 1) -> int:
|
||||
return super.f()
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Could not resolve member "f": Cyclic reference.
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
func test():
|
||||
print(v1)
|
||||
|
||||
var v1 := v2
|
||||
var v2 := v1
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Could not resolve member "v1": Cyclic reference.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
var v1 = v1
|
||||
|
||||
func test():
|
||||
print(v1)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Could not resolve member "v1": Cyclic reference.
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
func test():
|
||||
var lua_dict = {
|
||||
a = 1,
|
||||
b = 2,
|
||||
a = 3, # Duplicate isn't allowed.
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Key "a" was already used in this dictionary (at line 3).
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
func test():
|
||||
var lua_dict_with_string = {
|
||||
a = 1,
|
||||
b = 2,
|
||||
"a" = 3, # Duplicate isn't allowed.
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Key "a" was already used in this dictionary (at line 3).
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
func test():
|
||||
var python_dict = {
|
||||
"a": 1,
|
||||
"b": 2,
|
||||
"a": 3, # Duplicate isn't allowed.
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Key "a" was already used in this dictionary (at line 3).
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
# https://github.com/godotengine/godot/issues/62957
|
||||
|
||||
func test():
|
||||
var dict = {
|
||||
&"key": "StringName",
|
||||
"key": "String"
|
||||
}
|
||||
|
||||
print("Invalid dictionary: %s" % dict)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Key "key" was already used in this dictionary (at line 5).
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
func test():
|
||||
Time.new()
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cannot construct native class "Time" because it is an engine singleton.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
enum Enum {V1, V2}
|
||||
|
||||
func test():
|
||||
Enum.clear()
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cannot call non-const Dictionary function "clear()" on enum "Enum".
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
enum Enum {V1, V2}
|
||||
|
||||
func test():
|
||||
var bad = Enum.V3
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cannot find member "V3" in base "enum_bad_value.gd.Enum".
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
enum MyEnum { ENUM_VALUE_1, ENUM_VALUE_2 }
|
||||
enum MyOtherEnum { OTHER_ENUM_VALUE_1, OTHER_ENUM_VALUE_2 }
|
||||
|
||||
# Different enum types can't be assigned without casting.
|
||||
var class_var: MyEnum = MyEnum.ENUM_VALUE_1
|
||||
|
||||
func test():
|
||||
print(class_var)
|
||||
class_var = MyOtherEnum.OTHER_ENUM_VALUE_2
|
||||
print(class_var)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cannot assign a value of type "enum_class_var_assign_with_wrong_enum_type.gd.MyOtherEnum" as "enum_class_var_assign_with_wrong_enum_type.gd.MyEnum".
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
enum MyEnum { ENUM_VALUE_1, ENUM_VALUE_2 }
|
||||
enum MyOtherEnum { OTHER_ENUM_VALUE_1, OTHER_ENUM_VALUE_2 }
|
||||
|
||||
# Different enum types can't be assigned without casting.
|
||||
var class_var: MyEnum = MyOtherEnum.OTHER_ENUM_VALUE_1
|
||||
|
||||
func test():
|
||||
print(class_var)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cannot assign a value of type "enum_class_var_init_with_wrong_enum_type.gd.MyOtherEnum" as "enum_class_var_init_with_wrong_enum_type.gd.MyEnum".
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
enum Enum {V1, V2}
|
||||
|
||||
func test():
|
||||
var Enum2 = Enum
|
||||
Enum2.clear()
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cannot call non-const Dictionary function "clear()" on enum "Enum".
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
enum Size {
|
||||
# Error here. Enum values must be integers.
|
||||
S = 0.0,
|
||||
}
|
||||
|
||||
func test():
|
||||
pass
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Enum values must be integers.
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
enum MyEnum { ENUM_VALUE_1, ENUM_VALUE_2 }
|
||||
enum MyOtherEnum { OTHER_ENUM_VALUE_1, OTHER_ENUM_VALUE_2 }
|
||||
|
||||
func enum_func(e: MyEnum) -> void:
|
||||
print(e)
|
||||
|
||||
func test():
|
||||
enum_func(MyOtherEnum.OTHER_ENUM_VALUE_1)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cannot pass a value of type "enum_function_parameter_wrong_type.gd.MyOtherEnum" as "enum_function_parameter_wrong_type.gd.MyEnum".
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
enum MyEnum { ENUM_VALUE_1, ENUM_VALUE_2 }
|
||||
enum MyOtherEnum { OTHER_ENUM_VALUE_1, OTHER_ENUM_VALUE_2 }
|
||||
|
||||
func enum_func() -> MyEnum:
|
||||
return MyOtherEnum.OTHER_ENUM_VALUE_1
|
||||
|
||||
func test():
|
||||
print(enum_func())
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cannot return a value of type "enum_function_return_wrong_type.gd.MyOtherEnum" as "enum_function_return_wrong_type.gd.MyEnum".
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
enum MyEnum { ENUM_VALUE_1, ENUM_VALUE_2 }
|
||||
|
||||
class InnerClass:
|
||||
enum MyEnum { ENUM_VALUE_1, ENUM_VALUE_2 }
|
||||
|
||||
func test():
|
||||
var local_var: MyEnum = MyEnum.ENUM_VALUE_1
|
||||
print(local_var)
|
||||
local_var = InnerClass.MyEnum.ENUM_VALUE_2
|
||||
print(local_var)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cannot assign a value of type "enum_local_var_assign_outer_with_wrong_enum_type.gd::InnerClass.MyEnum" as "enum_local_var_assign_outer_with_wrong_enum_type.gd.MyEnum".
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
enum MyEnum { ENUM_VALUE_1, ENUM_VALUE_2 }
|
||||
enum MyOtherEnum { OTHER_ENUM_VALUE_1, OTHER_ENUM_VALUE_2 }
|
||||
|
||||
func test():
|
||||
var local_var: MyEnum = MyEnum.ENUM_VALUE_1
|
||||
print(local_var)
|
||||
local_var = MyOtherEnum.OTHER_ENUM_VALUE_2
|
||||
print(local_var)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cannot assign a value of type "enum_local_var_assign_with_wrong_enum_type.gd.MyOtherEnum" as "enum_local_var_assign_with_wrong_enum_type.gd.MyEnum".
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
enum MyEnum { ENUM_VALUE_1, ENUM_VALUE_2 }
|
||||
enum MyOtherEnum { OTHER_ENUM_VALUE_1, OTHER_ENUM_VALUE_2 }
|
||||
|
||||
func test():
|
||||
var local_var: MyEnum = MyOtherEnum.OTHER_ENUM_VALUE_1
|
||||
print(local_var)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Cannot assign a value of type "enum_local_var_init_with_wrong_enum_type.gd.MyOtherEnum" as "enum_local_var_init_with_wrong_enum_type.gd.MyEnum".
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
enum Vector2 { A, B }
|
||||
|
||||
func test():
|
||||
pass
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
The member "Vector2" cannot have the same name as a builtin type.
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
func test():
|
||||
var _bad = TileSet.TileShape.THIS_DOES_NOT_EXIST
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue