In this chapter, we have a topic about “Using Countable Ranges to Make an ArraySlice”
We have this code below
let upcomingPlayersSlice = players[1...2]
print(upcomingPlayersSlice[1], upcomingPlayersSlice[2])
// > "Bob Cindy\n"
But when I run it in a playground, I see the inferred type of upcomingPlayersSlice is Array<String>.SubSequence
.
Then, I just created a simple variable, where I explicitly set the type of ArraySlice and checked if can I assign to this variable our subsequence, and it works!
let arraySlice: ArraySlice = upcomingPlayersSlice
I am a little bit confused here, just the book said that we will create an ArraySlice type, I see that it is Subsequence type, and I see that it can be assigned to ArraySlice. Please could somebody guide me in the correct way of thinking about it?