mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Set an upper bound on the number of chained lookups we attempt to avoid spinning while trying to recursively apply the same dynamic member lookup to itself. rdar://157288911
8 lines
407 B
Swift
8 lines
407 B
Swift
// {"kind":"typecheck","signature":"swift::TypeTransform<swift::Type::transformRec(llvm::function_ref<std::__1::optional<swift::Type> (swift::TypeBase*)>) const::Transform>::doIt(swift::Type, swift::TypePosition)"}
|
|
// RUN: not %target-swift-frontend -typecheck %s
|
|
@dynamicMemberLookup struct S<T> {
|
|
init(_: () -> T) {}
|
|
subscript<U>(dynamicMember d: WritableKeyPath<T, U>) -> S<U> {}
|
|
}
|
|
let x = S { x.e }
|