feat: updated engine
This commit is contained in:
parent
cbe99774ff
commit
f4cf6b3999
6607 changed files with 910135 additions and 430025 deletions
|
|
@ -1,5 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 9: Native class "InstancePlaceholder" cannot be constructed as it is abstract.
|
||||
>> ERROR at line 9: Name "new" is a Callable. You can call it with "new.call()" instead.
|
||||
>> ERROR at line 10: Class "abstract_class_instantiate.gd::B" cannot be constructed as it is based on abstract native class "InstancePlaceholder".
|
||||
>> ERROR at line 10: Name "new" is a Callable. You can call it with "new.call()" instead.
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 37: "@abstract" annotation can only be used once per class.
|
||||
>> ERROR at line 28: "@abstract" annotation can only be used once per function.
|
||||
>> ERROR at line 35: "@abstract" annotation cannot be applied to static functions.
|
||||
>> ERROR at line 40: A lambda function must have a ":" followed by a body.
|
||||
>> ERROR at line 41: A lambda function must have a ":" followed by a body.
|
||||
>> ERROR at line 11: Class "Test1" is not abstract but contains abstract methods. Mark the class as "@abstract" or remove "@abstract" from all methods in this class.
|
||||
>> ERROR at line 14: Class "Test2" must implement "AbstractClass.some_func()" and other inherited abstract methods or be marked as "@abstract".
|
||||
>> ERROR at line 17: Class "Test3" must implement "AbstractClassAgain.some_func()" and other inherited abstract methods or be marked as "@abstract".
|
||||
>> ERROR at line 22: Cannot call the parent class' abstract function "some_func()" because it hasn't been defined.
|
||||
>> ERROR at line 25: Cannot call the parent class' abstract function "some_func()" because it hasn't been defined.
|
||||
>> ERROR at line 28: "@abstract" annotation can only be used once per function.
|
||||
>> ERROR at line 32: An abstract function cannot have a body.
|
||||
>> ERROR at line 35: "@abstract" annotation cannot be applied to static functions.
|
||||
>> ERROR at line 35: A function must either have a ":" followed by a body, or be marked as "@abstract".
|
||||
>> ERROR at line 37: "@abstract" annotation can only be used once per class.
|
||||
>> ERROR at line 40: A lambda function must have a ":" followed by a body.
|
||||
>> ERROR at line 41: A lambda function must have a ":" followed by a body.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
enum { VALUE }
|
||||
enum NamedEnum { VALUE }
|
||||
|
||||
const CONST = 0
|
||||
|
||||
signal signal_1
|
||||
signal signal_2
|
||||
|
||||
func test():
|
||||
VALUE = 1
|
||||
NamedEnum = {}
|
||||
NamedEnum.VALUE = 1
|
||||
CONST = 1
|
||||
signal_1 = signal_2
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 10: Cannot assign a new value to a constant.
|
||||
>> ERROR at line 11: Cannot assign a new value to a constant.
|
||||
>> ERROR at line 12: Cannot assign a new value to a constant.
|
||||
>> ERROR at line 13: Cannot assign a new value to a constant.
|
||||
>> ERROR at line 14: Cannot assign a new value to a constant.
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
enum { V }
|
||||
func test():
|
||||
V = 1
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 3: Cannot assign a new value to a constant.
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
enum NamedEnum { V }
|
||||
func test():
|
||||
NamedEnum.V = 1
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 3: Cannot assign a new value to a constant.
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
signal your_base
|
||||
signal my_base
|
||||
func test():
|
||||
your_base = my_base
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 4: Cannot assign a new value to a constant.
|
||||
|
|
@ -1,4 +1,10 @@
|
|||
func test():
|
||||
# Directly.
|
||||
var tree := SceneTree.new()
|
||||
tree.root = Window.new()
|
||||
tree.free()
|
||||
|
||||
# Indirectly.
|
||||
var state := PhysicsDirectBodyState3DExtension.new()
|
||||
state.center_of_mass.x += 1.0
|
||||
state.free()
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 3: Cannot assign a new value to a read-only property.
|
||||
>> ERROR at line 4: Cannot assign a new value to a read-only property.
|
||||
>> ERROR at line 9: Cannot assign a new value to a read-only property.
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
func test():
|
||||
var state := PhysicsDirectBodyState3DExtension.new()
|
||||
state.center_of_mass.x += 1.0
|
||||
state.free()
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 3: Cannot assign a new value to a read-only property.
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
func test():
|
||||
# Error here.
|
||||
print(2.2 << 4)
|
||||
print(2 >> 4.4)
|
||||
|
|
@ -1,2 +1,3 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 2: Invalid operands to operator <<, float and int.
|
||||
>> ERROR at line 3: Invalid operands to operator >>, int and float.
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
func test():
|
||||
# Error here.
|
||||
print(2.2 << 4)
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 3: Invalid operands to operator <<, float and int.
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
func test():
|
||||
var integer := 1
|
||||
print(integer as Array)
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 3: Invalid cast. Cannot convert from "int" to "Array".
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
func test():
|
||||
var integer := 1
|
||||
print(integer as Node)
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 3: Invalid cast. Cannot convert from "int" to "Node".
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 3: Invalid cast. Cannot convert from "RefCounted" to "int".
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
class Vector2:
|
||||
pass
|
||||
|
||||
func test():
|
||||
pass
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 1: Class "Vector2" hides a built-in type.
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
# GH-118877
|
||||
|
||||
class Test1:
|
||||
func _get_property_list() -> Array[int]:
|
||||
return []
|
||||
|
||||
class Test2:
|
||||
func _get_property_list() -> int:
|
||||
return 0
|
||||
|
||||
class Test3:
|
||||
func _get_property_list() -> void:
|
||||
pass
|
||||
|
||||
class Test4:
|
||||
func _get_property_list():
|
||||
return 0
|
||||
|
||||
func test():
|
||||
pass
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 4: The function signature doesn't match the parent. Parent signature is "_get_property_list() -> Array[Dictionary]".
|
||||
>> ERROR at line 8: The function signature doesn't match the parent. Parent signature is "_get_property_list() -> Array[Dictionary]".
|
||||
>> ERROR at line 12: The function signature doesn't match the parent. Parent signature is "_get_property_list() -> Array[Dictionary]".
|
||||
>> ERROR at line 17: Cannot return a value of type "int" as "Array".
|
||||
>> ERROR at line 17: Cannot return value of type "int" because the function return type is "Array".
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
func test():
|
||||
# GH-89357
|
||||
print(Color(""))
|
||||
print(Color("invalid"))
|
||||
|
||||
# GH-120049
|
||||
print(char(-1))
|
||||
print(char(0)) # The NUL character is not currently supported.
|
||||
print(char(0xD800))
|
||||
print(char(0x110000))
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 3: Invalid color code "".
|
||||
>> ERROR at line 4: Invalid color code "invalid".
|
||||
>> ERROR at line 7: Invalid argument for "char()" function: -1 is not a valid character code.
|
||||
>> ERROR at line 8: Invalid argument for "char()" function: 0 is not a valid character code.
|
||||
>> ERROR at line 9: Invalid argument for "char()" function: 55296 is not a valid character code.
|
||||
>> ERROR at line 10: Invalid argument for "char()" function: 1114112 is not a valid character code.
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
const array: Array = [0]
|
||||
|
||||
func test():
|
||||
var key: int = 0
|
||||
array[key] = 0
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 5: Cannot assign a new value to a constant.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
const ARRAY: Array = [0]
|
||||
const DICTIONARY: Dictionary = { 0: 0 }
|
||||
|
||||
func test():
|
||||
var key: int = 0
|
||||
ARRAY[key] = 0
|
||||
DICTIONARY[key] = 0
|
||||
|
|
@ -1,2 +1,3 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 6: Cannot assign a new value to a constant.
|
||||
>> ERROR at line 7: Cannot assign a new value to a constant.
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
const dictionary := {}
|
||||
|
||||
func test():
|
||||
var key: int = 0
|
||||
dictionary[key] = 0
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 5: Cannot assign a new value to a constant.
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
const Vector2 = 0
|
||||
|
||||
func test():
|
||||
pass
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 1: The member "Vector2" cannot have the same name as a builtin type.
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
const CONSTANT = 25
|
||||
|
||||
|
||||
func test():
|
||||
CONSTANT(123)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 5: Member "CONSTANT" is not a function.
|
||||
>> ERROR at line 5: Name "CONSTANT" called as a function but is a "int".
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
func test():
|
||||
print(InnerA.new())
|
||||
|
||||
class InnerA extends InnerB:
|
||||
pass
|
||||
|
||||
class InnerB extends InnerA:
|
||||
pass
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 4: Cyclic inheritance.
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
func test():
|
||||
print(c1)
|
||||
|
||||
const c1 = c2
|
||||
const c2 = c1
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 5: Could not resolve member "c1": Cyclic reference.
|
||||
>> ERROR at line 5: Could not resolve type for constant "c2".
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
func test():
|
||||
print(E1.V)
|
||||
|
||||
enum E1 {V = E2.V}
|
||||
enum E2 {V = E1.V}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 5: Could not resolve member "E1": Cyclic reference.
|
||||
>> ERROR at line 5: Enum values must be constant.
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
func test():
|
||||
print(EV1)
|
||||
|
||||
enum {EV1 = EV2}
|
||||
enum {EV2 = EV1}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 5: Could not resolve member "EV1": Cyclic reference.
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
func test():
|
||||
print(v)
|
||||
|
||||
var v = A.v
|
||||
|
||||
const A = preload("cyclic_ref_external_a.notest.gd")
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 4: Could not resolve external class member "v".
|
||||
>> ERROR at line 4: Cannot find member "v" in base "TestCyclicRefExternalA".
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
class_name TestCyclicRefExternalA
|
||||
|
||||
const B = preload("cyclic_ref_external.gd")
|
||||
|
||||
var v = B.v
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
func test():
|
||||
print(f1())
|
||||
print(f2())
|
||||
|
||||
static func f1(p := f2()) -> int:
|
||||
return 1
|
||||
|
||||
static func f2(p := f1()) -> int:
|
||||
return 2
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 8: Could not resolve member "f1": Cyclic reference.
|
||||
>> ERROR at line 8: Cannot infer the type of "p" parameter because the value doesn't have a set type.
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
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()
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 11: Could not resolve member "f": Cyclic reference.
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
func test():
|
||||
print(v1)
|
||||
|
||||
var v1 := v2
|
||||
var v2 := v1
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 5: Could not resolve member "v1": Cyclic reference.
|
||||
>> ERROR at line 5: Cannot infer the type of "v2" variable because the value doesn't have a set type.
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
var v1 = v1
|
||||
|
||||
func test():
|
||||
print(v1)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 1: Could not resolve member "v1": Cyclic reference.
|
||||
>> ERROR at line 1: Could not resolve type for variable "v1".
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
enum NamedEnum0 { VALUE = NamedEnum0.VALUE }
|
||||
enum NamedEnum1 { VALUE = NamedEnum2.VALUE }
|
||||
enum NamedEnum2 { VALUE = NamedEnum1.VALUE }
|
||||
|
||||
enum { ENUM_VALUE_0 = ENUM_VALUE_0 }
|
||||
enum { ENUM_VALUE_1 = ENUM_VALUE_2 }
|
||||
enum { ENUM_VALUE_2 = ENUM_VALUE_1 }
|
||||
|
||||
const CONST_0 = CONST_0
|
||||
const CONST_1 = CONST_2
|
||||
const CONST_2 = CONST_1
|
||||
|
||||
var var_0 = var_0
|
||||
var var_1 := var_2
|
||||
var var_2 := var_1
|
||||
|
||||
static func func_0(p := func_0()) -> int:
|
||||
return 0
|
||||
static func func_1(p := func_2()) -> int:
|
||||
return 1
|
||||
static func func_2(p := func_1()) -> int:
|
||||
return 2
|
||||
|
||||
var lambda_body = (func (_p): return 0).call(lambda_body_ref)
|
||||
var lambda_body_ref = lambda_body
|
||||
|
||||
var lambda_param = func (_p = lambda_param_ref): return 0
|
||||
var lambda_param_ref = lambda_param
|
||||
|
||||
const External = preload("cyclic_reference.notest.gd")
|
||||
var member = External.member
|
||||
|
||||
class InnerA:
|
||||
func f(p := InnerB.new().f()) -> int:
|
||||
return 1
|
||||
class InnerB extends InnerA:
|
||||
func f(p := 1) -> int:
|
||||
return super.f()
|
||||
|
||||
func test():
|
||||
pass
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
class_name TestCyclicRefExternal
|
||||
|
||||
const External = preload("cyclic_reference.gd")
|
||||
|
||||
var member = External.member
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 1: Could not resolve member "NamedEnum0": Cyclic reference.
|
||||
>> ERROR at line 1: Enum values must be constant.
|
||||
>> ERROR at line 3: Could not resolve member "NamedEnum1": Cyclic reference.
|
||||
>> ERROR at line 3: Enum values must be constant.
|
||||
>> ERROR at line 5: Cannot use another enum element before it was declared.
|
||||
>> ERROR at line 5: Enum values must be constant.
|
||||
>> ERROR at line 7: Could not resolve member "ENUM_VALUE_1": Cyclic reference.
|
||||
>> ERROR at line 9: Could not resolve member "CONST_0": Cyclic reference.
|
||||
>> ERROR at line 9: Could not resolve type for constant "CONST_0".
|
||||
>> ERROR at line 11: Could not resolve member "CONST_1": Cyclic reference.
|
||||
>> ERROR at line 11: Could not resolve type for constant "CONST_2".
|
||||
>> ERROR at line 13: Could not resolve member "var_0": Cyclic reference.
|
||||
>> ERROR at line 13: Could not resolve type for variable "var_0".
|
||||
>> ERROR at line 15: Could not resolve member "var_1": Cyclic reference.
|
||||
>> ERROR at line 15: Cannot infer the type of "var_2" variable because the value doesn't have a set type.
|
||||
>> ERROR at line 17: Could not resolve member "func_0": Cyclic reference.
|
||||
>> ERROR at line 17: Cannot infer the type of "p" parameter because the value doesn't have a set type.
|
||||
>> ERROR at line 21: Could not resolve member "func_1": Cyclic reference.
|
||||
>> ERROR at line 21: Cannot infer the type of "p" parameter because the value doesn't have a set type.
|
||||
>> ERROR at line 25: Could not resolve member "lambda_body": Cyclic reference.
|
||||
>> ERROR at line 25: Could not resolve type for variable "lambda_body_ref".
|
||||
>> ERROR at line 28: Could not resolve member "lambda_param": Cyclic reference.
|
||||
>> ERROR at line 28: Could not resolve type for variable "lambda_param_ref".
|
||||
>> ERROR at line 31: Could not resolve external class member "member".
|
||||
>> ERROR at line 31: Cannot find member "member" in base "TestCyclicRefExternal".
|
||||
>> ERROR at line 37: Could not resolve member "f": Cyclic reference.
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
func test():
|
||||
var lua_dict = {
|
||||
a = 1,
|
||||
b = 2,
|
||||
a = 3, # Duplicate isn't allowed.
|
||||
}
|
||||
var lua_dict_with_string = {
|
||||
a = 1,
|
||||
b = 2,
|
||||
"a" = 3, # Duplicate isn't allowed.
|
||||
}
|
||||
var python_dict = {
|
||||
"a": 1,
|
||||
"b": 2,
|
||||
"a": 3, # Duplicate isn't allowed.
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 5: Key "a" was already used in this dictionary (at line 3).
|
||||
>> ERROR at line 10: Key "a" was already used in this dictionary (at line 8).
|
||||
>> ERROR at line 15: Key "a" was already used in this dictionary (at line 13).
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
func test():
|
||||
var lua_dict = {
|
||||
a = 1,
|
||||
b = 2,
|
||||
a = 3, # Duplicate isn't allowed.
|
||||
}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 5: Key "a" was already used in this dictionary (at line 3).
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
func test():
|
||||
var lua_dict_with_string = {
|
||||
a = 1,
|
||||
b = 2,
|
||||
"a" = 3, # Duplicate isn't allowed.
|
||||
}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 5: Key "a" was already used in this dictionary (at line 3).
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
func test():
|
||||
var python_dict = {
|
||||
"a": 1,
|
||||
"b": 2,
|
||||
"a": 3, # Duplicate isn't allowed.
|
||||
}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 5: Key "a" was already used in this dictionary (at line 3).
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
func test():
|
||||
Time.new()
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 2: Cannot construct native class "Time" because it is an engine singleton.
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
enum Enum {V1, V2}
|
||||
|
||||
func test():
|
||||
Enum.clear()
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 4: Cannot call non-const Dictionary function "clear()" on enum "Enum".
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
enum Enum {V1, V2}
|
||||
|
||||
func test():
|
||||
var bad = Enum.V3
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 4: Cannot find member "V3" in base "enum_bad_value.gd.Enum".
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
func test():
|
||||
print(Vector3.Axis)
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 2: Type "Axis" in base "Vector3" cannot be used on its own.
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
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)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 9: 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".
|
||||
>> ERROR at line 9: Value of type "enum_class_var_assign_with_wrong_enum_type.gd.MyOtherEnum" cannot be assigned to a variable of type "enum_class_var_assign_with_wrong_enum_type.gd.MyEnum".
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
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)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 5: 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".
|
||||
>> ERROR at line 5: Cannot assign a value of type enum_class_var_init_with_wrong_enum_type.gd.MyOtherEnum to variable "class_var" with specified type enum_class_var_init_with_wrong_enum_type.gd.MyEnum.
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
enum BadEnum {
|
||||
A = 0.0,
|
||||
B = "hello",
|
||||
}
|
||||
|
||||
enum CustomEnum { A, B }
|
||||
|
||||
func test():
|
||||
print(Variant.Operator) # Global.
|
||||
print(Vector3.Axis) # Built-in.
|
||||
print(Node.ProcessMode) # Native.
|
||||
|
||||
print(Side.NOT_EXIST) # Global.
|
||||
print(Vector3.Axis.NOT_EXIST) # Built-in.
|
||||
print(TileSet.TileShape.NOT_EXIST) # Native.
|
||||
print(CustomEnum.NOT_EXIST) # Custom.
|
||||
|
||||
print(Side.size()) # Global.
|
||||
print(Vector3.Axis.size()) # Built-in.
|
||||
print(TileSet.TileShape.size()) # Native.
|
||||
|
||||
Side.clear() # Global.
|
||||
Vector3.Axis.clear() # Built-in.
|
||||
TileSet.TileShape.clear() # Native.
|
||||
CustomEnum.clear() # Custom.
|
||||
|
||||
var enum_type = CustomEnum
|
||||
enum_type.clear()
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 2: Enum values must be integers.
|
||||
>> ERROR at line 3: Enum values must be integers.
|
||||
>> ERROR at line 9: Type "Operator" in base "Variant" cannot be used on its own.
|
||||
>> ERROR at line 10: Type "Axis" in base "Vector3" cannot be used on its own.
|
||||
>> ERROR at line 11: Type "ProcessMode" in base "Node" cannot be used on its own.
|
||||
>> ERROR at line 13: Cannot find member "NOT_EXIST" in base "Side".
|
||||
>> ERROR at line 14: Cannot find member "NOT_EXIST" in base "Vector3.Axis".
|
||||
>> ERROR at line 15: Cannot find member "NOT_EXIST" in base "TileSet.TileShape".
|
||||
>> ERROR at line 16: Cannot find member "NOT_EXIST" in base "enum_declaration_and_usage.gd.CustomEnum".
|
||||
>> ERROR at line 18: Global enum "Side" cannot be used on its own.
|
||||
>> ERROR at line 18: The native enum "Side" does not behave like Dictionary and does not have methods of its own.
|
||||
>> ERROR at line 18: Static function "size()" not found in base "Side".
|
||||
>> ERROR at line 19: Type "Axis" in base "Vector3" cannot be used on its own.
|
||||
>> ERROR at line 19: Native class Vector3.Axis used in script doesn't exist or isn't exposed.
|
||||
>> ERROR at line 19: Static function "size()" not found in base "Variant".
|
||||
>> ERROR at line 20: Type "TileShape" in base "TileSet" cannot be used on its own.
|
||||
>> ERROR at line 20: Native class TileSet.TileShape used in script doesn't exist or isn't exposed.
|
||||
>> ERROR at line 20: Static function "size()" not found in base "Variant".
|
||||
>> ERROR at line 22: Global enum "Side" cannot be used on its own.
|
||||
>> ERROR at line 22: The native enum "Side" does not behave like Dictionary and does not have methods of its own.
|
||||
>> ERROR at line 22: Static function "clear()" not found in base "Side".
|
||||
>> ERROR at line 23: Type "Axis" in base "Vector3" cannot be used on its own.
|
||||
>> ERROR at line 23: Native class Vector3.Axis used in script doesn't exist or isn't exposed.
|
||||
>> ERROR at line 23: Static function "clear()" not found in base "Variant".
|
||||
>> ERROR at line 24: Type "TileShape" in base "TileSet" cannot be used on its own.
|
||||
>> ERROR at line 24: Native class TileSet.TileShape used in script doesn't exist or isn't exposed.
|
||||
>> ERROR at line 24: Static function "clear()" not found in base "Variant".
|
||||
>> ERROR at line 25: Cannot call non-const Dictionary function "clear()" on enum "CustomEnum".
|
||||
>> ERROR at line 28: Cannot call non-const Dictionary function "clear()" on enum "CustomEnum".
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
enum Enum {V1, V2}
|
||||
|
||||
func test():
|
||||
var Enum2 = Enum
|
||||
Enum2.clear()
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 5: Cannot call non-const Dictionary function "clear()" on enum "Enum".
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
enum Size {
|
||||
# Error here. Enum values must be integers.
|
||||
S = 0.0,
|
||||
}
|
||||
|
||||
func test():
|
||||
pass
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 3: Enum values must be integers.
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
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)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 8: Cannot pass a value of type "enum_function_parameter_wrong_type.gd.MyOtherEnum" as "enum_function_parameter_wrong_type.gd.MyEnum".
|
||||
>> ERROR at line 8: Invalid argument for "enum_func()" function: argument 1 should be "enum_function_parameter_wrong_type.gd.MyEnum" but is "enum_function_parameter_wrong_type.gd.MyOtherEnum".
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
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())
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 5: Cannot return a value of type "enum_function_return_wrong_type.gd.MyOtherEnum" as "enum_function_return_wrong_type.gd.MyEnum".
|
||||
>> ERROR at line 5: Cannot return value of type "enum_function_return_wrong_type.gd.MyOtherEnum" because the function return type is "enum_function_return_wrong_type.gd.MyEnum".
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
func test():
|
||||
print(Variant.Operator)
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 2: Type "Operator" in base "Variant" cannot be used on its own.
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
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)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 9: 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".
|
||||
>> ERROR at line 9: Value of type "enum_local_var_assign_outer_with_wrong_enum_type.gd::InnerClass.MyEnum" cannot be assigned to a variable of type "enum_local_var_assign_outer_with_wrong_enum_type.gd.MyEnum".
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
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)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
>> ERROR at line 7: 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".
|
||||
>> ERROR at line 7: Value of type "enum_local_var_assign_with_wrong_enum_type.gd.MyOtherEnum" cannot be assigned to a variable of type "enum_local_var_assign_with_wrong_enum_type.gd.MyEnum".
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
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)
|
||||
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