diff options
author | PreslavPetrov <preslavnpetrov@gmail.com> | 2024-05-04 18:41:01 +0100 |
---|---|---|
committer | PreslavPetrov <preslavnpetrov@gmail.com> | 2024-06-03 13:28:17 +0100 |
commit | 653a8b113a9677e534fa7061f39c7f56b3ed3663 (patch) | |
tree | ea858edeb57721114c02b9b29a75ba21aa981a02 /modules/gdscript/tests/scripts/parser | |
parent | 0d11108a01ca5017e055e498c579a271f3153ee1 (diff) | |
download | redot-engine-653a8b113a9677e534fa7061f39c7f56b3ed3663.tar.gz |
Register the export info correctly when a global class script is used as the variable type for Node
Diffstat (limited to 'modules/gdscript/tests/scripts/parser')
3 files changed, 12 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/parser/features/export_variable.gd b/modules/gdscript/tests/scripts/parser/features/export_variable.gd index 8b343de5ef..483e6cab0d 100644 --- a/modules/gdscript/tests/scripts/parser/features/export_variable.gd +++ b/modules/gdscript/tests/scripts/parser/features/export_variable.gd @@ -1,6 +1,8 @@ +class_name ExportVariableTest extends Node const Utils = preload("../../utils.notest.gd") +const PreloadedScript = preload("./export_variable.notest.gd") # Built-in types. @export var test_weak_int = 1 @@ -20,6 +22,10 @@ const Utils = preload("../../utils.notest.gd") @export var test_image: Image @export var test_timer: Timer +# Global custom classes. +@export var test_global_class: ExportVariableTest +@export var test_preloaded_script: PreloadedScript + # Arrays. @export var test_array: Array @export var test_array_bool: Array[bool] diff --git a/modules/gdscript/tests/scripts/parser/features/export_variable.notest.gd b/modules/gdscript/tests/scripts/parser/features/export_variable.notest.gd new file mode 100644 index 0000000000..6d064351c1 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/features/export_variable.notest.gd @@ -0,0 +1,2 @@ +class_name ExportPreloadedClassTest +extends Node diff --git a/modules/gdscript/tests/scripts/parser/features/export_variable.out b/modules/gdscript/tests/scripts/parser/features/export_variable.out index 99d7b27130..bb094e14b4 100644 --- a/modules/gdscript/tests/scripts/parser/features/export_variable.out +++ b/modules/gdscript/tests/scripts/parser/features/export_variable.out @@ -23,6 +23,10 @@ var test_image: Image = null hint=RESOURCE_TYPE hint_string="Image" usage=DEFAULT|SCRIPT_VARIABLE class_name=&"Image" var test_timer: Timer = null hint=NODE_TYPE hint_string="Timer" usage=DEFAULT|SCRIPT_VARIABLE class_name=&"Timer" +var test_global_class: ExportVariableTest = null + hint=NODE_TYPE hint_string="ExportVariableTest" usage=DEFAULT|SCRIPT_VARIABLE class_name=&"ExportVariableTest" +var test_preloaded_script: ExportPreloadedClassTest = null + hint=NODE_TYPE hint_string="ExportPreloadedClassTest" usage=DEFAULT|SCRIPT_VARIABLE class_name=&"ExportPreloadedClassTest" var test_array: Array = [] hint=NONE hint_string="" usage=DEFAULT|SCRIPT_VARIABLE class_name=&"" var test_array_bool: Array = Array[bool]([]) |