示例工程 04-collections-cow

04-collections-cow/Diagnostics/ImmutableAppend.swift

swift · 0.2 KB

// 故意编译失败:`let` 数组不能调用 mutating 方法。
// 复现:swiftc Diagnostics/ImmutableAppend.swift
let numbers = [1, 2, 3]
numbers.append(4)
print(numbers)