Skip to content

Commit a3444a0

Browse files
committed
Sema: Handle invalid conformance in ApplyClassifier::classifyApply()
1 parent d3cf1a4 commit a3444a0

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/Sema/TypeCheckEffects.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,6 +1684,8 @@ class ApplyClassifier {
16841684
const bool hasAnyConformances =
16851685
llvm::any_of(substitutions.getConformances(),
16861686
[](const ProtocolConformanceRef conformance) {
1687+
if (conformance.isInvalid())
1688+
return false;
16871689
auto *requirement = conformance.getProtocol();
16881690
return !requirement->getInvertibleProtocolKind();
16891691
});

validation-test/compiler_crashers_2/59b42964e169b6fa.swift renamed to validation-test/compiler_crashers_2_fixed/59b42964e169b6fa.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// {"signature":"swift::ProtocolConformanceRef::getProtocol() const"}
2-
// RUN: not --crash %target-swift-frontend -typecheck %s
2+
// RUN: not %target-swift-frontend -typecheck %s
33
func a<each b {
44
enum c {
55
case struct var d: e struct e {

0 commit comments

Comments
 (0)