Files
swift-mirror/validation-test/compiler_crashers_fixed/ContextualFailure-tryProtocolConformanceFixIt-1047d0.swift
Alastair Houghton 5db51f40a2 [Sema] tryProtocolConformanceFixIt() should not assert.
The assertion here should have been an `if` statement, because it's
possible to hit this where a type declares conformances to all of the
protocols but one of the conformances happens to be invalid.

Fixing this stops our previous fix from re-breaking one of the compiler
crashers in the validation test.

Additionally, one of the current compiler crashers was fixed by our
previous change, so move it to the right place and tweak it to test that
it is still fixed.

rdar://178854703
2026-06-30 15:39:08 +01:00

11 lines
492 B
Swift

// {"kind":"typecheck","original":"b9eafd0d","signature":"swift::constraints::ContextualFailure::tryProtocolConformanceFixIt() const","signatureAssert":"Assertion failed: (!missingProtoTypeStrings.empty() && \"type already conforms to all the protocols?\"), function tryProtocolConformanceFixIt","signatureNext":"ContextualFailure::tryFixIts"}
// RUN: not %target-swift-frontend -typecheck %s
protocol a<b> {
associatedtype b
}
struct c: a {
var d: a<Int> = {
c(<#expression#>)
}
}