mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Variable debug info is triggered by pattern bindings, however, inside a closure capture list, this should be avoided by setting the appropriate flag in the initializer object. rdar://110329894
27 lines
774 B
Swift
27 lines
774 B
Swift
// RUN: %target-swift-frontend %s -parse-as-library -module-name a -emit-sil -g -o - | %FileCheck %s
|
|
struct S {}
|
|
public class UIView {}
|
|
public protocol View {}
|
|
public final class Signal<Value> {
|
|
public func map<U>(_ transform: @escaping (Value) -> U) -> Signal<U> {
|
|
return Signal<U>()
|
|
}
|
|
}
|
|
public final class C<V: View, V1: View>: UIView {
|
|
private let t1: C<V, V1>? = nil
|
|
private let t2: C<V1, V>? = nil
|
|
func foo() -> Signal<(S, UIView)> {
|
|
// CHECK: sil {{.*}}s1a1CC3foo
|
|
// CHECK: debug_value {{.*}} name "self"
|
|
// CHECK-NOT: debug_value {{.*}} name "view"
|
|
// CHECK: return %
|
|
return (
|
|
Signal<S>()
|
|
.map { [view = t1!] in ($0, view) },
|
|
Signal<S>()
|
|
.map { [view = t2!] in ($0, view) }
|
|
).0
|
|
}
|
|
}
|
|
|