Browse Source

Add regression test for gdscript valid function signature

Previously, there was an issue where the gdscript analyzer incorrectly
riased a validation error for code that had a default Dictionary, Array,
or custom type.
CalebJohn 3 years ago
parent
commit
06a2d83e30

+ 14 - 0
modules/gdscript/tests/scripts/analyzer/features/function_match_parent_signature_with_default_dict_void.gd

@@ -0,0 +1,14 @@
+func test():
+	var instance := Parent.new()
+	instance.my_function({"a": 1})
+	instance = Child.new()
+	instance.my_function({"a": 1})
+	print("No failure")
+
+class Parent:
+	func my_function(_par1: Dictionary = {}) -> void:
+		pass
+
+class Child extends Parent:
+	func my_function(_par1: Dictionary = {}) -> void:
+		pass

+ 2 - 0
modules/gdscript/tests/scripts/analyzer/features/function_match_parent_signature_with_default_dict_void.out

@@ -0,0 +1,2 @@
+GDTEST_OK
+No failure