Q:

"Type of expression is ambiguous without more context" when creating UInt16 array from Bluetooth characteristic

I am using Xcode 9.2 and I don't understand the reason behind the error 

Type of expression is ambiguous without more context

I am getting some input  when trying to create and wordArray as showed below. If I define it as UInt8 array it does work but not if I do as Uint16 since I get the error. 
The original data, Characteristic.value comes from a BLE characteristic
let characteristicData = Characteristic.value

let byteArray = [UInt8](characteristicData!)
print("\(Characteristic.uuid) value as byte is->",byteArray)

let wordArray = [UInt16](characteristicData!)//Type of expression is ambiguous without more context
print("\(Characteristic.uuid) value as word is->",wordArray)

Why does this happen and how I can fix it?

A:

characteristicData has the type Data and that conforms to the
(RandomAccess)Collection protocol with UInt8 as element type, that's why you can
initialize an [UInt8] array from it:
let byteArray = [UInt8](characteristicData)

You could equivalently write 
let byteArray = Array(characteristicData)

To interpret the data as an array of a different type, use
the generic 
func withUnsafeBytes<ResultType, ContentType>(_ body: (UnsafePointer<ContentType>) throws -> ResultType) rethrows -> ResultType

method:
let wordArray = characteristicData.withUnsafeBytes {
    [UInt16](UnsafeBufferPointer(start: $0, count: characteristicData.count/2))
}

Here the ContentType is inferred automatically as UInt16.

