summaryrefslogtreecommitdiff
path: root/modules/gdscript/tests/scripts/analyzer
diff options
context:
space:
mode:
authorrune-scape <allie.smith.epic@gmail.com>2022-12-12 07:27:41 -0500
committerrune-scape <allie.smith.epic@gmail.com>2022-12-12 07:27:41 -0500
commit08449ab16ecba2c04511b5da464f75d241eaff95 (patch)
tree98f340abdb02b8a2c16ee33000061b7ff9bb9686 /modules/gdscript/tests/scripts/analyzer
parent97df6de4a77393069c639a57d22bebb2f6f54680 (diff)
Fix String type compatibility being too permissive
Diffstat (limited to 'modules/gdscript/tests/scripts/analyzer')
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/array_string_stringname_equivalent.gd7
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/array_string_stringname_equivalent.out2
2 files changed, 9 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/analyzer/features/array_string_stringname_equivalent.gd b/modules/gdscript/tests/scripts/analyzer/features/array_string_stringname_equivalent.gd
index 4511c3d10b..eb0003eed8 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/array_string_stringname_equivalent.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/array_string_stringname_equivalent.gd
@@ -1,4 +1,11 @@
+
+var m_string_array: Array[String] = [&"abc"]
+var m_stringname_array: Array[StringName] = ["abc"]
+
func test():
+ print(m_string_array)
+ print(m_stringname_array)
+
# Converted to String when initialized
var string_array: Array[String] = [&"abc"]
print(string_array)
diff --git a/modules/gdscript/tests/scripts/analyzer/features/array_string_stringname_equivalent.out b/modules/gdscript/tests/scripts/analyzer/features/array_string_stringname_equivalent.out
index 70dd01d88e..09c199bde1 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/array_string_stringname_equivalent.out
+++ b/modules/gdscript/tests/scripts/analyzer/features/array_string_stringname_equivalent.out
@@ -1,3 +1,5 @@
GDTEST_OK
["abc"]
[&"abc"]
+["abc"]
+[&"abc"]