We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 22185d2 commit c515b53Copy full SHA for c515b53
lib/AST/Decl.cpp
@@ -2110,9 +2110,9 @@ bool NominalTypeDecl::derivesProtocolConformance(ProtocolDecl *protocol) const {
2110
return nominal == C.getStringDecl() || nominal == C.getIntDecl();
2111
}
2112
2113
- // Empty enums are allowed to conform as well.
2114
- return enumDecl->getAllElements().empty() ||
2115
- enumDecl->hasOnlyCasesWithoutAssociatedValues();
+ // hasOnlyCasesWithoutAssociatedValues will return true for empty enums;
+ // empty enumas are allowed to conform as well.
+ return enumDecl->hasOnlyCasesWithoutAssociatedValues();
2116
2117
2118
default:
0 commit comments