示例工程 22-swift6-strict-concurrency

22-swift6-strict-concurrency/Diagnostics/GlobalMutable.swift

swift · 0.2 KB

// 故意编译失败:非隔离的全局可变状态不并发安全。
// 复现:swiftc -swift-version 6 Diagnostics/GlobalMutable.swift
var shared = 0
 
func bump() {
    shared += 1
}