This code:
let d0 = Data(bytes: [10, 11, 12, 13, 14, 15])
print(d0[2])
print(d0[3])
let d1 = d0[2...3]
print(d1.count)
print(d1[0])...produces this output in an Xcode 9.3 / Swift 4.1 playground:
12
13
2...and then crashes on the last line:
print(d1[0])...with this error:
error: Execution was interrupted, reason: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0).
Is this a bug, and if so, any suggestions for a workaround?