Skip to content

Commit 4223fc6

Browse files
Update CollectionValue.cs
1 parent bf2f944 commit 4223fc6

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

ValueSystem/CollectionValue.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ public Value[] CastedValues
1414

1515
List<Value> list = [];
1616
list.AddRange(from object item in value select Parse(item));
17-
if (list.Any(i => i is not LiteralValue and not ReferenceValue))
18-
{
19-
throw new ScriptRuntimeError("Collection was detected with illegal values.");
20-
}
21-
17+
2218
if (list.Select(i => i.GetType()).Distinct().Count() > 1)
2319
{
2420
throw new ScriptRuntimeError("Collection was detected with mixed types.");
@@ -44,8 +40,6 @@ public TryGet<Value> GetAt(int index)
4440

4541
public override string ToString()
4642
{
47-
List<string> objects = [];
48-
objects.AddRange(from object? obj in CastedValues select obj?.ToString() ?? "???");
49-
return $"[{string.Join(", ", objects)}]";
43+
return $"[{string.Join(", ", CastedValues.Select(v => v.ToString()))}]";
5044
}
5145
}

0 commit comments

Comments
 (0)