If the return type was Array<Leaf | Aggregator>, wouldn't TypeScript be able to infer the right type U in Array<T>.concat => Array<U> ?
Or as others point out, array spread does widen unlike concat (because it isn't an in-place operation).
https://news.ycombinator.com/item?id=18907771
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...