mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This leads to unhandled complications in the move-only checker that were causing miscompiles. We can disallow this for now. rdar://109695770
20 lines
320 B
Swift
20 lines
320 B
Swift
// RUN: %target-swift-frontend -emit-sil -verify %s
|
|
|
|
enum E: Error { case err }
|
|
|
|
struct NC: ~Copyable {
|
|
let x = 0
|
|
|
|
deinit { print("deinit") }
|
|
}
|
|
|
|
func chk(_ cond: Bool) throws {
|
|
let y: NC // expected-error{{not supported}} expected-warning{{never used}}
|
|
if cond {
|
|
y = NC()
|
|
}
|
|
throw E.err
|
|
}
|
|
|
|
try? chk(true)
|