Files
swift-mirror/test/SILOptimizer/lifetime_dependence/rdar177002500.swift
Aidan Hall f139e8aca2 Lifetimes: Add a regression test for partial apply result types
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.
2026-05-18 15:02:13 +01:00

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 {}