ID:2387120
 
Not a bug
BYOND Version:512.1441
Operating System:Windows 10 Pro
Web Browser:Chrome 65.0.3325.181
Applies to:DM Language
Status: Not a bug

This is not a bug. It may be an incorrect use of syntax or a limitation in the software. For further discussion on the matter, please consult the BYOND forums.
Descriptive Problem Summary:
Adding empty list to existing list does nothing

Numbered Steps to Reproduce Problem:

Code Snippet (if applicable) to Reproduce Problem:
mob
Login()
var/list/L = list(new/list(), list())
world << "A [length(L)]"
L.Add(list())
world << "B [length(L)]"
L.Add(new/list())
world << "C [length(L)]"
var/list/X = list()
L.Add(X)
world << "D [length(L)]"


Expected Results:
A 2
B 3
C 4
D 5

Actual Results:
A 2
B 2
C 2
D 2
This is not a bug. It's also been reported before.

list.Add() concatenates lists; it adds the contents of lists passed to it, not the lists themselves. It doesn't add them as elements. Adding nothing to a list has no effect, as you'd expect.

If you want to add a list as an element of another list, you'd have to do this:
L[++L.len] = new/list
Kaiochao resolved issue (Not a bug)
Wow, this really sucks. There should be separate proc for list concatenation :/
Another workaround: L.Add(list(list()))

Also useful for adding non-empty lists: L.Add(list(list("a" = 5)))