Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Content.Tests/DMProject/Tests/List/ListOr.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/proc/RunTest()
var/list/L1 = list("a" = 1, "b" = 2)
var/list/L2 = list("c" = 3, "d" = 4)
var/list/result = L1 | L2

ASSERT(result ~= list("a" = 1, "b" = 2, "c" = 3, "d" = 4))
2 changes: 1 addition & 1 deletion OpenDreamRuntime/Objects/Types/DreamList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ public virtual int GetLength() {
}

public DreamList Union(DreamList other) {
DreamList newList = new DreamList(ObjectDefinition, _values.Union(other.GetValues()).ToList(), null);
DreamList newList = new DreamList(ObjectDefinition, _values.Union(other.EnumerateValues()).ToList(), IsAssociative ? new(_associativeValues!) : null);
foreach ((DreamValue key, DreamValue value) in other.GetAssociativeValues()) {
newList.SetValue(key, value);
}
Expand Down
Loading