feat: godot-engine-source-4.3-stable

This commit is contained in:
Jan van der Weide 2025-01-17 16:36:38 +01:00
parent c59a7dcade
commit 7125d019b5
11149 changed files with 5070401 additions and 0 deletions

View file

@ -0,0 +1,2 @@
func test():
InstancePlaceholder.new()

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Native class "InstancePlaceholder" cannot be constructed as it is abstract.

View file

@ -0,0 +1,9 @@
class A extends InstancePlaceholder:
func _init():
print('no')
class B extends A:
pass
func test():
B.new()

View file

@ -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".

View file

@ -0,0 +1,6 @@
var num := 1
@export_range(num, 10) var a
func test():
pass

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Argument 1 of annotation "@export_range" isn't a constant expression.

View file

@ -0,0 +1,3 @@
enum { V }
func test():
V = 1

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Cannot assign a new value to a constant.

View file

@ -0,0 +1,3 @@
enum NamedEnum { V }
func test():
NamedEnum.V = 1

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Cannot assign a new value to a constant.

View file

@ -0,0 +1,4 @@
signal your_base
signal my_base
func test():
your_base = my_base

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Cannot assign a new value to a constant.

View file

@ -0,0 +1,4 @@
func test():
var tree := SceneTree.new()
tree.root = Window.new()
tree.free()

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Cannot assign a new value to a read-only property.

View file

@ -0,0 +1,4 @@
func test():
var state := PhysicsDirectBodyState3DExtension.new()
state.center_of_mass.x += 1.0
state.free()

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Cannot assign a new value to a read-only property.

View file

@ -0,0 +1,3 @@
func test():
var var_color: String = Color.RED
print('not ok')

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Cannot assign a value of type "Color" as "String".

View file

@ -0,0 +1,4 @@
signal my_signal()
func test():
var _a := await my_signal

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Cannot infer the type of "_a" variable because the value doesn't have a set type.

View file

@ -0,0 +1,3 @@
func test():
# Error here.
print(2.2 << 4)

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Invalid operands to operator <<, float and int.

View file

@ -0,0 +1,3 @@
func test():
# Error here.
print(2 >> 4.4)

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Invalid operands to operator >>, int and float.

View file

@ -0,0 +1,7 @@
# GH-73283
class MyClass:
pass
func test():
MyClass.not_existing_method()

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Static function "not_existing_method()" not found in base "MyClass".

View file

@ -0,0 +1,3 @@
func test():
var integer := 1
print(integer as Array)

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Invalid cast. Cannot convert from "int" to "Array".

View file

@ -0,0 +1,3 @@
func test():
var integer := 1
print(integer as Node)

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Invalid cast. Cannot convert from "int" to "Node".

View file

@ -0,0 +1,3 @@
func test():
var object := RefCounted.new()
print(object as int)

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Invalid cast. Cannot convert from "RefCounted" to "int".

View file

@ -0,0 +1,5 @@
class Vector2:
pass
func test():
pass

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Class "Vector2" hides a built-in type.

View file

@ -0,0 +1,5 @@
const array: Array = [0]
func test():
var key: int = 0
array[key] = 0

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Cannot assign a new value to a constant.

View file

@ -0,0 +1,5 @@
const dictionary := {}
func test():
var key: int = 0
dictionary[key] = 0

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Cannot assign a new value to a constant.

View file

@ -0,0 +1,4 @@
const Vector2 = 0
func test():
pass

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
The member "Vector2" cannot have the same name as a builtin type.

View file

@ -0,0 +1,5 @@
const base := [0]
func test():
var sub := base[0]
if sub is String: pass

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Expression is of type "int" so it can't be of type "String".

View file

@ -0,0 +1,5 @@
const CONSTANT = 25
func test():
CONSTANT(123)

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Member "CONSTANT" is not a function.

View file

@ -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)

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Expression is of type "B" so it can't be of type "C".

View file

@ -0,0 +1,8 @@
func test():
print(InnerA.new())
class InnerA extends InnerB:
pass
class InnerB extends InnerA:
pass

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Cyclic inheritance.

View file

@ -0,0 +1,5 @@
func test():
print(c1)
const c1 = c2
const c2 = c1

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Could not resolve member "c1": Cyclic reference.

View file

@ -0,0 +1,5 @@
func test():
print(E1.V)
enum E1 {V = E2.V}
enum E2 {V = E1.V}

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Could not resolve member "E1": Cyclic reference.

View file

@ -0,0 +1,5 @@
func test():
print(EV1)
enum {EV1 = EV2}
enum {EV2 = EV1}

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Could not resolve member "EV1": Cyclic reference.

View file

@ -0,0 +1,6 @@
func test():
print(v)
var v = A.v
const A = preload("cyclic_ref_external_a.notest.gd")

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Could not resolve external class member "v".

View file

@ -0,0 +1,3 @@
const B = preload("cyclic_ref_external.gd")
var v = B.v

View file

@ -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

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Could not resolve member "f1": Cyclic reference.

View file

@ -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()

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Could not resolve member "f": Cyclic reference.

View file

@ -0,0 +1,5 @@
func test():
print(v1)
var v1 := v2
var v2 := v1

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Could not resolve member "v1": Cyclic reference.

View file

@ -0,0 +1,4 @@
var v1 = v1
func test():
print(v1)

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Could not resolve member "v1": Cyclic reference.

View file

@ -0,0 +1,6 @@
func test():
var lua_dict = {
a = 1,
b = 2,
a = 3, # Duplicate isn't allowed.
}

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Key "a" was already used in this dictionary (at line 3).

View file

@ -0,0 +1,6 @@
func test():
var lua_dict_with_string = {
a = 1,
b = 2,
"a" = 3, # Duplicate isn't allowed.
}

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Key "a" was already used in this dictionary (at line 3).

View file

@ -0,0 +1,6 @@
func test():
var python_dict = {
"a": 1,
"b": 2,
"a": 3, # Duplicate isn't allowed.
}

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Key "a" was already used in this dictionary (at line 3).

View file

@ -0,0 +1,9 @@
# https://github.com/godotengine/godot/issues/62957
func test():
var dict = {
&"key": "StringName",
"key": "String"
}
print("Invalid dictionary: %s" % dict)

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Key "key" was already used in this dictionary (at line 5).

View file

@ -0,0 +1,2 @@
func test():
Time.new()

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Cannot construct native class "Time" because it is an engine singleton.

View file

@ -0,0 +1,4 @@
enum Enum {V1, V2}
func test():
Enum.clear()

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Cannot call non-const Dictionary function "clear()" on enum "Enum".

View file

@ -0,0 +1,4 @@
enum Enum {V1, V2}
func test():
var bad = Enum.V3

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Cannot find member "V3" in base "enum_bad_value.gd.Enum".

View file

@ -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)

View file

@ -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".

View file

@ -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)

View file

@ -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".

View file

@ -0,0 +1,5 @@
enum Enum {V1, V2}
func test():
var Enum2 = Enum
Enum2.clear()

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Cannot call non-const Dictionary function "clear()" on enum "Enum".

View file

@ -0,0 +1,7 @@
enum Size {
# Error here. Enum values must be integers.
S = 0.0,
}
func test():
pass

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
Enum values must be integers.

View file

@ -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)

View file

@ -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".

View file

@ -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())

View file

@ -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".

View file

@ -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)

View file

@ -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".

View file

@ -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)

View file

@ -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".

View file

@ -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)

View file

@ -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".

View file

@ -0,0 +1,4 @@
enum Vector2 { A, B }
func test():
pass

View file

@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
The member "Vector2" cannot have the same name as a builtin type.

View file

@ -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