From 41e57c606b030f6219a58d393273d104dda93edc Mon Sep 17 00:00:00 2001 From: wixoa Date: Thu, 23 Jul 2026 06:58:18 -0400 Subject: [PATCH 1/2] Fix `list() | list()` not including the first list's associated values --- OpenDreamRuntime/Objects/Types/DreamList.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenDreamRuntime/Objects/Types/DreamList.cs b/OpenDreamRuntime/Objects/Types/DreamList.cs index 8611f126a2..0c9a653b1f 100644 --- a/OpenDreamRuntime/Objects/Types/DreamList.cs +++ b/OpenDreamRuntime/Objects/Types/DreamList.cs @@ -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); } From 341b547af6e5a793a6e700406469ef303ebed5af Mon Sep 17 00:00:00 2001 From: wixoa Date: Thu, 23 Jul 2026 06:59:51 -0400 Subject: [PATCH 2/2] Include a test --- Content.Tests/DMProject/Tests/List/ListOr.dm | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Content.Tests/DMProject/Tests/List/ListOr.dm diff --git a/Content.Tests/DMProject/Tests/List/ListOr.dm b/Content.Tests/DMProject/Tests/List/ListOr.dm new file mode 100644 index 0000000000..4983c4be3c --- /dev/null +++ b/Content.Tests/DMProject/Tests/List/ListOr.dm @@ -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)) \ No newline at end of file