summaryrefslogtreecommitdiff
path: root/modules/gdscript/tests/scripts
diff options
context:
space:
mode:
authorAdam Scott <ascott.ca@gmail.com>2022-12-14 08:33:53 -0500
committerAdam Scott <ascott.ca@gmail.com>2022-12-17 12:03:03 -0500
commit2fefcf7329287c34ee9c5143ab96a7976d96a33e (patch)
treed01f06a3bfe8a99fd82efcae170d9354b3f9094d /modules/gdscript/tests/scripts
parent8d52eea52b4914a26409823047fc2ffd82c294f0 (diff)
Fix inner class constant assignment
Diffstat (limited to 'modules/gdscript/tests/scripts')
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/inner_class_constant_assignment.gd7
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/inner_class_constant_assignment.out2
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/inner_class_constant_assignment_external.notest.gd2
3 files changed, 11 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/analyzer/features/inner_class_constant_assignment.gd b/modules/gdscript/tests/scripts/analyzer/features/inner_class_constant_assignment.gd
new file mode 100644
index 0000000000..ed5fb18b73
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/features/inner_class_constant_assignment.gd
@@ -0,0 +1,7 @@
+const External = preload("inner_class_constant_assignment_external.notest.gd")
+const ExternalInnerClass = External.InnerClass
+
+func test():
+ var inst_external: ExternalInnerClass = ExternalInnerClass.new()
+ inst_external.x = 4.0
+ print(inst_external.x)
diff --git a/modules/gdscript/tests/scripts/analyzer/features/inner_class_constant_assignment.out b/modules/gdscript/tests/scripts/analyzer/features/inner_class_constant_assignment.out
new file mode 100644
index 0000000000..15666c46ad
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/features/inner_class_constant_assignment.out
@@ -0,0 +1,2 @@
+GDTEST_OK
+4
diff --git a/modules/gdscript/tests/scripts/analyzer/features/inner_class_constant_assignment_external.notest.gd b/modules/gdscript/tests/scripts/analyzer/features/inner_class_constant_assignment_external.notest.gd
new file mode 100644
index 0000000000..788c99d469
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/features/inner_class_constant_assignment_external.notest.gd
@@ -0,0 +1,2 @@
+class InnerClass:
+ var x: = 3.0