示例工程 20-async-await-structured-concurrency

20-async-await-structured-concurrency/Diagnostics/README.md

markdown · 0.5 KB

# Diagnostics
 
三个文件**故意编译失败**,用来复现第 20 章「报错现场」的真实诊断。
 
```bash
swiftc Diagnostics/MissingAwait.swift     # error: expression is 'async' but is not marked with 'await'
swiftc Diagnostics/AwaitInSync.swift      # error: 'await' in a function that does not support concurrency
swiftc -swift-version 6 Diagnostics/CaptureMutation.swift
                                          # error: mutation of captured var in concurrently-executing code
```