mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Surprisingly, there are some situations where an extension can end up with _fewer_ constraints than the extended type. That was baked-in as an assertion in this new-ish method. I haven't figured out why that can happen in the reproducer only when using `-interpret` mode. It didn't trigger the assertion for me when compiling normally. The fix is simple: check all the requirements, rather than using a short-cut. resolves rdar://125659789 / https://github.com/apple/swift/issues/72719
18 lines
404 B
Swift
18 lines
404 B
Swift
// RUN: %target-swift-frontend -interpret %s
|
|
// REQUIRES: executable_test
|
|
|
|
// This only reproduced if you provide the -interpret flag!
|
|
// https://github.com/apple/swift/issues/72719
|
|
|
|
protocol D {}
|
|
struct U: D, Equatable {}
|
|
class Q<T> {}
|
|
class R<V, E: D & Equatable> {}
|
|
extension R where E == U {
|
|
struct S<X> {}
|
|
static func a<T>(_: T) -> R {
|
|
let x = Q<S<T>>()
|
|
fatalError()
|
|
}
|
|
}
|