Skip to content

Commit 9d333ee

Browse files
committed
Fix a crash
1 parent b5e4b08 commit 9d333ee

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/Sema/TypeCheckDecl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,8 @@ swift::computeAutomaticEnumValueKind(EnumDecl *ED) {
11071107
// primitive literal protocols.
11081108
auto conformsToProtocol = [&](KnownProtocolKind protoKind) {
11091109
ProtocolDecl *proto = ED->getASTContext().getProtocol(protoKind);
1110-
return TypeChecker::conformsToProtocol(rawTy, proto, ED->getDeclContext());
1110+
return proto &&
1111+
TypeChecker::conformsToProtocol(rawTy, proto, ED->getDeclContext());
11111112
};
11121113

11131114
static auto otherLiteralProtocolKinds = {

validation-test/compiler_scale/enum_indirect.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %scale-test --sum-multi --begin 5 --end 16 --step 5 --select InterfaceTypeRequest %s
1+
// RUN: %scale-test --sum-multi --begin 5 --end 15 --step 5 --select InterfaceTypeRequest %s
22
// REQUIRES: asserts
33

44
indirect enum Enum${N} {

0 commit comments

Comments
 (0)