mirror of
https://github.com/apple/swift.git
synced 2026-10-12 14:50:47 +02:00
This was a minimal reproducer for the crash caused by the lifetimes of a partial_apply's result not matching what was expected: rdar://177002500 This was fixed on main by PR #89053.
18 lines
411 B
Swift
18 lines
411 B
Swift
// RUN: %target-swift-frontend -emit-sil -O -enable-experimental-feature Lifetimes %s
|
|
|
|
// REQUIRES: swift_feature_Lifetimes
|
|
|
|
// Minimal reproducer for SIL optimizer crash: rdar://177002500
|
|
|
|
func foo(x: Int) {
|
|
bar { (_: consuming A<Void>) -> B in
|
|
_ = x
|
|
fatalError()
|
|
}
|
|
}
|
|
|
|
func bar<T>(_: @_lifetime(copy a) (_ a: consuming A<T>) -> B) {}
|
|
|
|
struct A<T>: ~Escapable {}
|
|
struct B: ~Escapable {}
|