With
$ swift --version
swift-driver version: 1.127.14.1 Apple Swift version 6.2 (swiftlang-6.2.0.19.9 clang-1700.3.19.1)
Target: arm64-apple-macosx15.0
And this file:
import Foundation
struct Foo: ~Copyable {
init() {}
}
func bar() {
var foo: Foo?
NSFileCoordinator().coordinate(writingItemAt: URL(filePath: "/tmp/irrelevant"), options: .forMerging, error: nil, byAccessor: { url in
foo = Foo()
})
_ = foo
}
bar() // usage so the function isn't compiled outr
the compiler complains and tells me to file a bug, so here’s a first attempt at that ![]()
$ swift test.swift
test.swift:8:9: error: usage of a noncopyable type that compiler can't verify. This is a compiler bug. Please file a bug with a small example of the bug
6 |
7 | func bar() {
8 | var foo: Foo?
| `- error: usage of a noncopyable type that compiler can't verify. This is a compiler bug. Please file a bug with a small example of the bug
9 | NSFileCoordinator().coordinate(writingItemAt: URL(filePath: "/tmp/irrelevant"), options: .forMerging, error: nil, byAccessor: { url in
10 | foo = Foo()