From 13be0ab733d83a494f3dbaedd94cc00d0dbe0d88 Mon Sep 17 00:00:00 2001 From: "ocean (they/them)" Date: Tue, 8 Nov 2022 17:41:50 -0500 Subject: Fix ability to overload "script" variable --- .../tests/scripts/analyzer/errors/overload_script_variable.gd | 6 ++++++ .../tests/scripts/analyzer/errors/overload_script_variable.out | 2 ++ .../analyzer/errors/variable_overloads_superclass_function.gd | 9 +++++++++ .../analyzer/errors/variable_overloads_superclass_function.out | 2 ++ 4 files changed, 19 insertions(+) create mode 100644 modules/gdscript/tests/scripts/analyzer/errors/overload_script_variable.gd create mode 100644 modules/gdscript/tests/scripts/analyzer/errors/overload_script_variable.out create mode 100644 modules/gdscript/tests/scripts/analyzer/errors/variable_overloads_superclass_function.gd create mode 100644 modules/gdscript/tests/scripts/analyzer/errors/variable_overloads_superclass_function.out (limited to 'modules/gdscript/tests') diff --git a/modules/gdscript/tests/scripts/analyzer/errors/overload_script_variable.gd b/modules/gdscript/tests/scripts/analyzer/errors/overload_script_variable.gd new file mode 100644 index 0000000000..5c8b9fa4ae --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/errors/overload_script_variable.gd @@ -0,0 +1,6 @@ +extends Node + +var script: int + +func test(): + pass diff --git a/modules/gdscript/tests/scripts/analyzer/errors/overload_script_variable.out b/modules/gdscript/tests/scripts/analyzer/errors/overload_script_variable.out new file mode 100644 index 0000000000..8454aaa404 --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/errors/overload_script_variable.out @@ -0,0 +1,2 @@ +GDTEST_ANALYZER_ERROR +Member "script" redefined (original in native class 'Node') diff --git a/modules/gdscript/tests/scripts/analyzer/errors/variable_overloads_superclass_function.gd b/modules/gdscript/tests/scripts/analyzer/errors/variable_overloads_superclass_function.gd new file mode 100644 index 0000000000..28561ff94b --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/errors/variable_overloads_superclass_function.gd @@ -0,0 +1,9 @@ +func test(): + pass + +class A: + func overload_me(): + pass + +class B extends A: + var overload_me diff --git a/modules/gdscript/tests/scripts/analyzer/errors/variable_overloads_superclass_function.out b/modules/gdscript/tests/scripts/analyzer/errors/variable_overloads_superclass_function.out new file mode 100644 index 0000000000..32357f9f6a --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/errors/variable_overloads_superclass_function.out @@ -0,0 +1,2 @@ +GDTEST_ANALYZER_ERROR +The member "overload_me" already exists in parent class A. -- cgit v1.2.3