diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2023-01-16 22:20:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-16 22:20:44 +0100 |
commit | 1c3653e0833badd62574c5f07c1ec1ee4a6a27cb (patch) | |
tree | 1adfbdcc3e2d37d1db51ef45acd6302618a9c89c /modules/gdscript/tests/scripts/parser | |
parent | 2c2691276211e13857950d076631b5a420a6896e (diff) | |
parent | 6590e1fd8a0770894626d012c2391f2ae1efa497 (diff) |
Merge pull request #67774 from aaronfranke/script-annotations
Make script annotations be placed before `class_name` and `extends`
Diffstat (limited to 'modules/gdscript/tests/scripts/parser')
3 files changed, 4 insertions, 4 deletions
diff --git a/modules/gdscript/tests/scripts/parser/errors/class_name_after_annotation.gd b/modules/gdscript/tests/scripts/parser/errors/class_name_after_annotation.gd index 179e454073..0085b3f367 100644 --- a/modules/gdscript/tests/scripts/parser/errors/class_name_after_annotation.gd +++ b/modules/gdscript/tests/scripts/parser/errors/class_name_after_annotation.gd @@ -1,6 +1,6 @@ -# Error here. `class_name` should be used *before* annotations, not after (except @tool). -@icon("res://path/to/optional/icon.svg") +# Error here. Annotations should be used before `class_name`, not after. class_name HelloWorld +@icon("res://path/to/optional/icon.svg") func test(): pass diff --git a/modules/gdscript/tests/scripts/parser/errors/class_name_after_annotation.out b/modules/gdscript/tests/scripts/parser/errors/class_name_after_annotation.out index 02b33c8692..a598ff8424 100644 --- a/modules/gdscript/tests/scripts/parser/errors/class_name_after_annotation.out +++ b/modules/gdscript/tests/scripts/parser/errors/class_name_after_annotation.out @@ -1,2 +1,2 @@ GDTEST_PARSER_ERROR -"class_name" should be used before annotations (except @tool). +Annotation "@icon" is not allowed in this level. diff --git a/modules/gdscript/tests/scripts/parser/features/class_name.gd b/modules/gdscript/tests/scripts/parser/features/class_name.gd index 8bd188e247..19009e433d 100644 --- a/modules/gdscript/tests/scripts/parser/features/class_name.gd +++ b/modules/gdscript/tests/scripts/parser/features/class_name.gd @@ -1,5 +1,5 @@ -class_name HelloWorld @icon("res://path/to/optional/icon.svg") +class_name HelloWorld func test(): pass |