Files
swift-mirror/test/IDE/issue-80591.swift
Hamish Knight 9114aad02c [Sema] Ignore types with type variables in filterEscapableLifetimeDependencies
If the type still has type variables, avoid trying to check if it's
escapable.

rdar://148749815
2025-04-08 14:14:42 +01:00

19 lines
657 B
Swift

// RUN: %batch-code-completion -enable-experimental-feature LifetimeDependence
// REQUIRES: swift_feature_LifetimeDependence
infix operator ^^^
extension Optional where Wrapped: ~Escapable & ~Copyable {
@lifetime(copy self) mutating func foo() -> Self { fatalError() }
}
func ^^^ <T: ~Escapable & ~Copyable> (_ x: Int, _ y: borrowing T?) {}
// https://github.com/swiftlang/swift/issues/80591 - Make sure we don't crash
// here.
func foo() {
_ = 1 ^^^ .#^COMPLETE^#
// COMPLETE: Decl[InstanceMethod]/CurrNominal/TypeRelation[Convertible]: foo({#(self): &Optional<~Copyable & ~Escapable>#})[#() -> Optional<~Copyable & ~Escapable>#]; name=foo(:)
}