Skip to content

Instantly share code, notes, and snippets.

@adamchalmers
Created September 11, 2017 15:00
Show Gist options
  • Save adamchalmers/5b7c7129f722118c3b06a7dd9ad049a0 to your computer and use it in GitHub Desktop.
Save adamchalmers/5b7c7129f722118c3b06a7dd9ad049a0 to your computer and use it in GitHub Desktop.
let array = Array(0..<10)
let slice = array[2..<5]
// Mixing Array/ArraySlice compiles!
print(extend(array, withNewElems: array))
print(extend(array, withNewElems: slice))
print(extend(slice, withNewElems: slice))
// Mixing Ints/Bools doesn't compile!
print(extend(array, withNewElems: [true, false]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment