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 d22a247 commit 401d297Copy full SHA for 401d297
lib/AST/ProtocolConformance.cpp
@@ -990,9 +990,12 @@ static bool isVanishingTupleConformance(
990
991
auto replacementTypes = substitutions.getReplacementTypes();
992
assert(replacementTypes.size() == 1);
993
- auto packType = replacementTypes[0]->castTo<PackType>();
994
995
- return (packType->getNumElements() == 1 &&
+ // This might not be an actual pack type with an invalid tuple conformance.
+ auto packType = replacementTypes[0]->getAs<PackType>();
996
+
997
+ return (packType &&
998
+ packType->getNumElements() == 1 &&
999
!packType->getElementTypes()[0]->is<PackExpansionType>());
1000
}
1001
0 commit comments