Files
swift-mirror/validation-test/execution/issue-72719.swift
Kavon Farvardin 273549239b AST: fix isWrittenWithConstraints
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
2024-06-12 17:20:49 -07:00

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()
}
}