summaryrefslogtreecommitdiff
path: root/modules/gdscript/tests
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-02-26 19:02:27 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-02-26 19:02:27 +0100
commitc0f1ed57c44253c88a7d27e9727a305fb2155e51 (patch)
treec024aec9607b5b2e1215fb57810dca5c8a645d90 /modules/gdscript/tests
parenta12ecd4c95dbb7029cb0e37fb44d473ab53534f8 (diff)
parent281c8c75d321570c0f47e68171260cadf8c5a817 (diff)
Merge pull request #73915 from vonagam/fix-conversions-from-native-member
GDScript: Fix conversions from native members accessed by identifier
Diffstat (limited to 'modules/gdscript/tests')
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/conversions_from_native_members.gd11
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/conversions_from_native_members.out2
2 files changed, 13 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/runtime/features/conversions_from_native_members.gd b/modules/gdscript/tests/scripts/runtime/features/conversions_from_native_members.gd
new file mode 100644
index 0000000000..a778fb1a94
--- /dev/null
+++ b/modules/gdscript/tests/scripts/runtime/features/conversions_from_native_members.gd
@@ -0,0 +1,11 @@
+class Foo extends Node:
+ func _init():
+ name = 'f'
+ var string: String = name
+ assert(typeof(string) == TYPE_STRING)
+ assert(string == 'f')
+ print('ok')
+
+func test():
+ var foo := Foo.new()
+ foo.free()
diff --git a/modules/gdscript/tests/scripts/runtime/features/conversions_from_native_members.out b/modules/gdscript/tests/scripts/runtime/features/conversions_from_native_members.out
new file mode 100644
index 0000000000..1b47ed10dc
--- /dev/null
+++ b/modules/gdscript/tests/scripts/runtime/features/conversions_from_native_members.out
@@ -0,0 +1,2 @@
+GDTEST_OK
+ok