语言地基
类型系统与抽象
并发、内存与性能
互操作与工程
SwiftUI 基础
SwiftUI 进阶
macOS 工程
iOS
综合
附录
07-optionals
07-optionals/Sources/Ch07Crash/App.swift
swift · 0.2 KB
import Foundation @main struct Ch07Crash { static func main() { let missing: Int? = nil FileHandle.standardError.write(Data("about to force unwrap\n".utf8)) let value = missing! print("unreachable \(value)") } }
该文件由构建期采集,未做任何改写;源码页不进入搜索引擎索引。