语言地基
类型系统与抽象
并发、内存与性能
互操作与工程
SwiftUI 基础
SwiftUI 进阶
macOS 工程
iOS
综合
附录
24-performance-instruments
24-performance-instruments/Diagnostics/DurationPlusInt.swift
swift · 0.2 KB
// 故意编译失败:Duration 不能直接与 Int 相加。 // 复现:swiftc -typecheck Diagnostics/DurationPlusInt.swift import Foundation let timeout = Duration.seconds(1) + 1 print(timeout)
该文件由构建期采集,未做任何改写;源码页不进入搜索引擎索引。