mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
The logic here could form AST loops due to passing in `anchor` for the key path's parsed path. However setting a parsed path here seems to be a holdover from the CSDiag days, so set the path to `nullptr` and rip out and the rest of the synthesis and SanitizeExpr logic for it. rdar://85236369
29 lines
565 B
Swift
29 lines
565 B
Swift
// RUN: %target-swift-frontend -dump-ast %s | %FileCheck %s
|
|
|
|
struct Q {
|
|
var x: Int
|
|
}
|
|
|
|
@dynamicMemberLookup
|
|
struct R {
|
|
subscript(dynamicMember dynamicMember: KeyPath<Q, Int>) -> Int {
|
|
fatalError()
|
|
}
|
|
}
|
|
|
|
@dynamicMemberLookup
|
|
struct S {
|
|
subscript(dynamicMember dynamicMember: KeyPath<R, Int>) -> Int {
|
|
fatalError()
|
|
}
|
|
}
|
|
|
|
// rdar://85236369 - We shouldn't synthesize a parsed root or path, we should
|
|
// just have the original parsed root.
|
|
|
|
// CHECK-NOT: (parsed_root
|
|
// CHECK-NOT: (parsed_path
|
|
// CHECK: (parsed_root
|
|
// CHECK-NOT: (parsed_path
|
|
_ = \S.x
|