示例工程 17-reflection-keypaths

17-reflection-keypaths/Diagnostics/README.md

markdown · 0.5 KB

# Diagnostics
 
三个文件**故意编译失败**,用来复现第 17 章「报错现场」的真实诊断。
 
```bash
swiftc Diagnostics/KeyPathOnLet.swift        # error: cannot assign through subscript: 'point' is a 'let' constant
swiftc Diagnostics/KeyPathTypeMismatch.swift # error: cannot assign value of type 'String' to subscript of type 'Int'
swiftc Diagnostics/MissingDynamicMember.swift # error: requires 'Settings' to have a 'subscript(dynamicMember:)' method
```