Hugo’s append implementation:
https://github.com/gohugoio/hugo/blob/master/tpl/collections/append.go#L22-L37
I am pretty sure the answer to your question is here:
https://golang.org/ref/spec#Passing_arguments_to_..._parameters
My take on this: if the “from” slice is not assignable to the “to” slice, a new slice is appended. But I’ve read the spec several times and I’m still not sure I understand it.
{{ $s1 := slice (slice "a" "b") }}
{{ $s2 := slice "c" "d" }}
{{ $s1 | append $s2 | append $s2 }} => [[a b] c d [c d]]
{{ $s1 | append ($s2 | append $s2) }} => [[a b] c d c d]