示例工程 35-state-and-data-flow

35-state-and-data-flow/Diagnostics/README.md

markdown · 0.5 KB

# Diagnostics
 
三个文件**故意编译失败**,用来复现第 35 章「报错现场」的真实诊断。
 
```bash
swiftc -typecheck Diagnostics/BindableOnValue.swift   # error: wrapped value must be an object that conforms to Observable
swiftc -typecheck Diagnostics/ObservableStruct.swift  # error: '@Observable' cannot be applied to struct
swiftc -typecheck Diagnostics/StateObjectOnInt.swift  # error: requires that 'Int' conform to 'ObservableObject'
```