diff options
author | Abel Toy <abeltoy@hey.com> | 2023-10-07 19:32:08 +0900 |
---|---|---|
committer | Abel Toy <abeltoy@hey.com> | 2024-03-06 16:17:54 +0900 |
commit | 882441a0ad00fed66bf5d0859e36e7f369d9d509 (patch) | |
tree | 4ba0feb24ecf6fb99b91126f4328ed56a7f779ed /modules/gdscript/tests/scripts/parser/errors | |
parent | f2045ba822bff7d34964901393581a3117c394a9 (diff) | |
download | redot-engine-882441a0ad00fed66bf5d0859e36e7f369d9d509.tar.gz |
Support Array and PackedArray in @export_*
Diffstat (limited to 'modules/gdscript/tests/scripts/parser/errors')
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. |