mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
If the type still has type variables, avoid trying to check if it's escapable. rdar://148749815
19 lines
657 B
Swift
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(:)
|
|
}
|