Avatar
swiftbot BOT 10/9/2018 9:21 AM
Author icon
koher
struct RGBA<Channel> { var red: Channel var green: Channel var blue: Channel var alpha: Channel } let rgbaArray = [RGBA(red: 255, green: 127, blue: 0, alpha: 255)] rgbaArray.withUnsafeBufferPointer { rgbaPointer in print(rgbaPointer[0]) rgbaPointer.withMemoryRebound(to: UInt8.self) { uint8Pointer in print(uint8Pointer[0]) } }
Version:
swift-4.1.1-RELEASE
Output:
Error:
Fatal error: Current stack trace: 0 libswiftCore.so 0x00007fc6d3c55750 _swift_stdlib_reportFatalError + 171 1 libswiftCore.so 0x00007fc6d39c3ad6 <unavailable> + 1366742 2 libswiftCore.so 0x00007fc6d3bfe383 <unavailable> + 3703683 3 libswiftCore.so 0x00007fc6d39c3ad6 <unavailable> + 1366742 4 libswiftCore.so 0x00007fc6d3b2fd80 <unavailable> + 2858368 5 libswiftCore.so 0x00007fc6d3af7ded <unavailable> + 2629101 6 libswiftCore.so 0x00007fc6d3af7c20 UnsafeBufferPointer.withMemoryRebound<A, B>(to:_:) + 42 10 libswiftCore.so 0x00007fc6d39bde30 Array.withUnsafeBufferPointer<A>(_:) + 172 12 swift 0x0000000000fed1ce <unavailable> + 12505550 13 swift 0x0000000000ff1692 <unavailable> + 12523154 ...
9:21 AM