mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Otherwise, debug info asserts get triggered because of a missing debug loc. rdar://36797675
19 lines
511 B
Swift
19 lines
511 B
Swift
// RUN: %target-swift-frontend -g -emit-ir %s | %FileCheck %s
|
|
|
|
public struct Gen<Value> {
|
|
public private(set) var value: Value
|
|
public func use<Subject>(keyPath: WritableKeyPath<Value, Subject>) {
|
|
}
|
|
}
|
|
|
|
// This used to assert.
|
|
|
|
// CHECK: distinct !DISubprogram(linkageName: "keypath_set", {{.*}} flags: DIFlagArtificial
|
|
extension Gen where Value : MutableCollection, Value.Index : Hashable {
|
|
public var dontAssert: Int {
|
|
var i = value.startIndex
|
|
use(keyPath: \.[i])
|
|
return 0
|
|
}
|
|
}
|