Files
swift-mirror/validation-test/compiler_crashers_fixed/issue-52031.swift
Hamish Knight 4e811c3a88 [test] Merge crasher directories
There is no longer much of a good reason to keep these separate,
merge them.
2025-10-18 12:51:30 +01:00

19 lines
592 B
Swift

// RUN: %target-typecheck-verify-swift -requirement-machine-max-rule-length=4
// https://github.com/apple/swift/issues/52031
struct S<N> {}
protocol P {
associatedtype A: P = Self
static func f(_ x: A) -> A
}
extension S: P where N: P {
static func f<X: P>(_ x: X) -> S<X.A> where A == X, X.A == N {
// expected-error@-1 {{cannot build rewrite system for generic signature; rule length limit exceeded}}
// expected-note@-2 {{τ_0_0.[P:A].[P:A].[P:A].[P:A].[P:A].[concrete: S<S<S<S<S<S<τ_0_0>>>>>>] => τ_0_0.[P:A].[P:A].[P:A].[P:A].[P:A] [subst]}}
return S<X.A>()
}
}