From 882441a0ad00fed66bf5d0859e36e7f369d9d509 Mon Sep 17 00:00:00 2001 From: Abel Toy Date: Sat, 7 Oct 2023 19:32:08 +0900 Subject: Support Array and PackedArray in @export_* --- .../tests/scripts/parser/errors/export_enum_wrong_array_type.gd | 4 ++++ .../tests/scripts/parser/errors/export_enum_wrong_array_type.out | 2 ++ .../gdscript/tests/scripts/parser/errors/export_enum_wrong_type.gd | 4 ++++ .../gdscript/tests/scripts/parser/errors/export_enum_wrong_type.out | 2 ++ 4 files changed, 12 insertions(+) create mode 100644 modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_array_type.gd create mode 100644 modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_array_type.out create mode 100644 modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_type.gd create mode 100644 modules/gdscript/tests/scripts/parser/errors/export_enum_wrong_type.out (limited to 'modules/gdscript/tests/scripts/parser/errors') 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. -- cgit v1.2.3