Files
swift-mirror/test/expr/unary/keypath/rdar85236369.swift
Hamish Knight d6ac93efb1 [CS] Don't set parsed paths for dynamic member key paths
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
2021-11-15 12:25:17 +00:00

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