From b004f8180e37d1d3a6f06bb5f7f6992b8f0ad5d2 Mon Sep 17 00:00:00 2001 From: Danil Alexeev Date: Wed, 18 Jan 2023 20:12:33 +0300 Subject: GDScript: Allow constant expressions in annotations --- .../scripts/analyzer/errors/annotation_non_constant_parameter.gd | 6 ++++++ .../scripts/analyzer/errors/annotation_non_constant_parameter.out | 2 ++ 2 files changed, 8 insertions(+) create mode 100644 modules/gdscript/tests/scripts/analyzer/errors/annotation_non_constant_parameter.gd create mode 100644 modules/gdscript/tests/scripts/analyzer/errors/annotation_non_constant_parameter.out (limited to 'modules/gdscript/tests/scripts/analyzer/errors') diff --git a/modules/gdscript/tests/scripts/analyzer/errors/annotation_non_constant_parameter.gd b/modules/gdscript/tests/scripts/analyzer/errors/annotation_non_constant_parameter.gd new file mode 100644 index 0000000000..75524c32ae --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/errors/annotation_non_constant_parameter.gd @@ -0,0 +1,6 @@ +var num := 1 + +@export_range(num, 10) var a + +func test(): + pass diff --git a/modules/gdscript/tests/scripts/analyzer/errors/annotation_non_constant_parameter.out b/modules/gdscript/tests/scripts/analyzer/errors/annotation_non_constant_parameter.out new file mode 100644 index 0000000000..b4f0e79237 --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/errors/annotation_non_constant_parameter.out @@ -0,0 +1,2 @@ +GDTEST_ANALYZER_ERROR +Argument 1 of annotation "@export_range" isn't a constant expression. -- cgit v1.2.3