summaryrefslogtreecommitdiff
path: root/modules/gdscript/tests/scripts/runtime/features
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2023-01-11 01:05:37 +0100
committerGitHub <noreply@github.com>2023-01-11 01:05:37 +0100
commit08ba509f8c71aa12159e9b20c1ed3b688c4412c3 (patch)
tree9956a6b9c89d5f12881d04879274ed21689e9be0 /modules/gdscript/tests/scripts/runtime/features
parent91713ced81792b10fdc9367b7f355738e5d52777 (diff)
parent04d0e851eae29cb0205ef4f820466a0d9d68d8a1 (diff)
Merge pull request #71192 from vnen/gdscript-fix-variant-conversion-assign
GDScript: Fix use of conversion assign for variant values
Diffstat (limited to 'modules/gdscript/tests/scripts/runtime/features')
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/use_conversion_assign_with_variant_value.gd9
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/use_conversion_assign_with_variant_value.out3
2 files changed, 12 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/runtime/features/use_conversion_assign_with_variant_value.gd b/modules/gdscript/tests/scripts/runtime/features/use_conversion_assign_with_variant_value.gd
new file mode 100644
index 0000000000..af3f3cb941
--- /dev/null
+++ b/modules/gdscript/tests/scripts/runtime/features/use_conversion_assign_with_variant_value.gd
@@ -0,0 +1,9 @@
+# https://github.com/godotengine/godot/issues/71172
+
+func test():
+ @warning_ignore(narrowing_conversion)
+ var foo: int = 0.0
+ print(typeof(foo) == TYPE_INT)
+ var dict : Dictionary = {"a":0.0}
+ foo = dict.get("a")
+ print(typeof(foo) == TYPE_INT)
diff --git a/modules/gdscript/tests/scripts/runtime/features/use_conversion_assign_with_variant_value.out b/modules/gdscript/tests/scripts/runtime/features/use_conversion_assign_with_variant_value.out
new file mode 100644
index 0000000000..9d111a8322
--- /dev/null
+++ b/modules/gdscript/tests/scripts/runtime/features/use_conversion_assign_with_variant_value.out
@@ -0,0 +1,3 @@
+GDTEST_OK
+true
+true