summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests/scripts/parser/errors
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-03-06 09:49:53 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-03-06 09:49:53 +0100
commit0acc4276b6825d872648fddfbd74c00c63d36741 (patch)
treefe2d3b4be44638e2d455d84ab974891cb107fda1 /modules/gdscript/tests/scripts/parser/errors
parent1b2e0b32d727ceab387afcabba422f994038e439 (diff)
parent882441a0ad00fed66bf5d0859e36e7f369d9d509 (diff)
downloadredot-engine-0acc4276b6825d872648fddfbd74c00c63d36741.tar.gz
Merge pull request #82952 from AbelToy/gds-export-array
Allow `@export`ed Arrays to set property hints for their elements
Diffstat (limited to 'modules/gdscript/tests/scripts/parser/errors')
-rw-r--r--modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_array_type.gd4
-rw-r--r--modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_array_type.out2
-rw-r--r--modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_type.gd4
-rw-r--r--modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_type.out2
4 files changed, 12 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_array_type.gd b/modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_array_type.gd
new file mode 100644
index 0000000000..9f1a52856d
--- /dev/null
+++ b/modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_array_type.gd
@@ -0,0 +1,4 @@
+@export_enum("A", "B", "C") var x: Array[Color]
+
+func test():
+ pass
diff --git a/modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_array_type.out b/modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_array_type.out
new file mode 100644
index 0000000000..1e0455b96d
--- /dev/null
+++ b/modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_array_type.out
@@ -0,0 +1,2 @@
+GDTEST_ANALYZER_ERROR
+"@export_enum" annotation requires a variable of type "int", "Array[int]", "PackedByteArray", "PackedInt32Array", "PackedInt64Array", "String", "Array[String]", or "PackedStringArray", but type "Array[Color]" was given instead.
diff --git a/modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_type.gd b/modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_type.gd
new file mode 100644
index 0000000000..5fe66e7cce
--- /dev/null
+++ b/modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_type.gd
@@ -0,0 +1,4 @@
+@export_enum("A", "B", "C") var x: Color
+
+func test():
+ pass
diff --git a/modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_type.out b/modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_type.out
new file mode 100644
index 0000000000..43a08acc0a
--- /dev/null
+++ b/modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_type.out
@@ -0,0 +1,2 @@
+GDTEST_ANALYZER_ERROR
+"@export_enum" annotation requires a variable of type "int", "Array[int]", "PackedByteArray", "PackedInt32Array", "PackedInt64Array", "String", "Array[String]", or "PackedStringArray", but type "Color" was given instead.