Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

GDScript: Add a few more tests related to name conflicts

HolonProductioncdf831a54419
diff --git a/.github/changed_files.yml b/.github/changed_files.yml
index 871fbbeb92a..1922fe7b2dc 100644
--- a/.github/changed_files.yml
+++ b/.github/changed_files.yml
@@ -11,6 +11,7 @@ sources:
- "**/{SConstruct,SCsub,*.py}"
- "**/*.{h,hpp,hh,hxx,c,cpp,cc,cxx,m,mm,inc,glsl}"
- misc/extension_api_validation/**
+ - modules/*/tests/**
- modules/mono/**/*.{cs,csproj,sln,props,targets}
- platform/android/java/{gradle*,**/*.{jar,java,kt,gradle}}
- platform/web/{package{,-lock}.json,js/**/*.js}
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/overload_script_variable.gd b/modules/gdscript/tests/scripts/analyzer/errors/overload_script_variable.gd
deleted file mode 100644
index 5c8b9fa4ae6..00000000000
--- a/modules/gdscript/tests/scripts/analyzer/errors/overload_script_variable.gd
+++ /dev/null
@@ -1,6 +0,0 @@
-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
deleted file mode 100644
index 57bd1865901..00000000000
--- a/modules/gdscript/tests/scripts/analyzer/errors/overload_script_variable.out
+++ /dev/null
@@ -1,2 +0,0 @@
-GDTEST_ANALYZER_ERROR
->> ERROR at line 3: Member "script" redefined (original in native class 'Node')
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/shadowing.gd b/modules/gdscript/tests/scripts/analyzer/errors/shadowing.gd
index 1011bd7630b..c059c6a239b 100644
--- a/modules/gdscript/tests/scripts/analyzer/errors/shadowing.gd
+++ b/modules/gdscript/tests/scripts/analyzer/errors/shadowing.gd
@@ -8,6 +8,14 @@ class Vector2: pass
enum Vector2i { A, B }
const Vector3 = 0
var Vector3i
+var Node = ""
+var script: int
+
+class C extends Resource:
+ const changed: int = 0
+ var resource_name: String
+ var NOTIFICATION_POSTINITIALIZE = 1
+
func test():
pass
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/shadowing.out b/modules/gdscript/tests/scripts/analyzer/errors/shadowing.out
index 7890486e8b8..6e0d65c6fe8 100644
--- a/modules/gdscript/tests/scripts/analyzer/errors/shadowing.out
+++ b/modules/gdscript/tests/scripts/analyzer/errors/shadowing.out
@@ -4,3 +4,8 @@ GDTEST_ANALYZER_ERROR
>> ERROR at line 8: The member "Vector2i" cannot have the same name as a builtin type.
>> ERROR at line 9: The member "Vector3" cannot have the same name as a builtin type.
>> ERROR at line 10: The member "Vector3i" cannot have the same name as a builtin type.
+>> ERROR at line 11: The member "Node" shadows a native class.
+>> ERROR at line 12: Member "script" redefined (original in native class 'RefCounted')
+>> ERROR at line 15: Member "changed" redefined (original in native class 'Resource')
+>> ERROR at line 16: Member "resource_name" redefined (original in native class 'Resource')
+>> ERROR at line 17: Member "NOTIFICATION_POSTINITIALIZE" redefined (original in native class 'Resource')