Open
Description
Description
While I appreciate the opportunity for histrionics, we should probably cap the number of times you're allowed to write the unsafe
keyword at 1. The code below compiles for me using the June 12 nightly toolchain.
Reproduction
func superDuperUnsafe(_ bytes: UnsafeRawBufferPointer) {
let byte = unsafe unsafe unsafe unsafe unsafe unsafe unsafe bytes.first ?? 0
print(byte)
}
Expected behavior
A compiler error on the second (and following) use of unsafe
Environment
Apple Swift version 6.2-dev (LLVM d266fd9f80a7945, Swift 665515c)
Target: arm64-apple-macosx26.0
Build config: +assertions
Additional information
rdar://153672668