Files
swift-mirror/validation-test/compiler_crashers_2_fixed/a5fbf4336df96867.swift
Hamish Knight fb7f2d0ff2 [CS] Limit the number of chained @dynamicMemberLookup lookups
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
2025-08-01 19:08:04 +01:00

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 }