| 1 |
# GH-82169 |
| 2 |
|
| 3 |
@warning_ignore_start("unused_signal") |
| 4 |
|
| 5 |
@abstract class A: |
| 6 |
@abstract func test_abstract_func_1() |
| 7 |
@abstract func test_abstract_func_2() |
| 8 |
func test_override_func_1(): pass |
| 9 |
func test_override_func_2(): pass |
| 10 |
|
| 11 |
class B extends A: |
| 12 |
static var test_static_var_b1 |
| 13 |
static var test_static_var_b2 |
| 14 |
var test_var_b1 |
| 15 |
var test_var_b2 |
| 16 |
static func test_static_func_b1(): pass |
| 17 |
static func test_static_func_b2(): pass |
| 18 |
func test_abstract_func_1(): pass |
| 19 |
func test_abstract_func_2(): pass |
| 20 |
func test_override_func_1(): pass |
| 21 |
func test_override_func_2(): pass |
| 22 |
func test_func_b1(): pass |
| 23 |
func test_func_b2(): pass |
| 24 |
signal test_signal_b1() |
| 25 |
signal test_signal_b2() |
| 26 |
|
| 27 |
class C extends B: |
| 28 |
static var test_static_var_c1 |
| 29 |
static var test_static_var_c2 |
| 30 |
var test_var_c1 |
| 31 |
var test_var_c2 |
| 32 |
static func test_static_func_c1(): pass |
| 33 |
static func test_static_func_c2(): pass |
| 34 |
func test_abstract_func_1(): pass |
| 35 |
func test_abstract_func_2(): pass |
| 36 |
func test_override_func_1(): pass |
| 37 |
func test_override_func_2(): pass |
| 38 |
func test_func_c1(): pass |
| 39 |
func test_func_c2(): pass |
| 40 |
signal test_signal_c1() |
| 41 |
signal test_signal_c2() |
| 42 |
|
| 43 |
func test_property_signature(name: String, base: Object, is_static: bool = false) -> void: |
| 44 |
prints("---", name, "---") |
| 45 |
for property in base.get_property_list(): |
| 46 |
if str(property.name).begins_with("test_"): |
| 47 |
print(Utils.get_property_signature(property, null, is_static)) |
| 48 |
|
| 49 |
func test_method_signature(name: String, base: Object) -> void: |
| 50 |
prints("---", name, "---") |
| 51 |
for method in base.get_method_list(): |
| 52 |
if str(method.name).begins_with("test_"): |
| 53 |
print(Utils.get_method_signature(method)) |
| 54 |
|
| 55 |
func test_signal_signature(name: String, base: Object) -> void: |
| 56 |
prints("---", name, "---") |
| 57 |
for method in base.get_signal_list(): |
| 58 |
if str(method.name).begins_with("test_"): |
| 59 |
print(Utils.get_method_signature(method, true)) |
| 60 |
|
| 61 |
func test(): |
| 62 |
var b := B.new() |
| 63 |
var c := C.new() |
| 64 |
|
| 65 |
print("=== Class Properties ===") |
| 66 |
test_property_signature("A", A as GDScript, true) |
| 67 |
test_property_signature("B", B as GDScript, true) |
| 68 |
test_property_signature("C", C as GDScript, true) |
| 69 |
print("=== Member Properties ===") |
| 70 |
test_property_signature("B", b) |
| 71 |
test_property_signature("C", c) |
| 72 |
print("=== Class Methods ===") |
| 73 |
test_method_signature("A", A as GDScript) |
| 74 |
test_method_signature("B", B as GDScript) |
| 75 |
test_method_signature("C", C as GDScript) |
| 76 |
print("=== Member Methods ===") |
| 77 |
test_method_signature("B", b) |
| 78 |
test_method_signature("C", c) |
| 79 |
print("=== Signals ===") |
| 80 |
test_signal_signature("B", b) |
| 81 |
test_signal_signature("C", c) |