diff options
author | Adam Scott <ascott.ca@gmail.com> | 2022-12-14 08:33:53 -0500 |
---|---|---|
committer | Adam Scott <ascott.ca@gmail.com> | 2022-12-17 12:03:03 -0500 |
commit | 2fefcf7329287c34ee9c5143ab96a7976d96a33e (patch) | |
tree | d01f06a3bfe8a99fd82efcae170d9354b3f9094d /modules/gdscript/tests/scripts | |
parent | 8d52eea52b4914a26409823047fc2ffd82c294f0 (diff) |
Fix inner class constant assignment
Diffstat (limited to 'modules/gdscript/tests/scripts')
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 |