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 115acc2 commit 824fa48Copy full SHA for 824fa48
stdlib/public/runtime/DynamicCast.cpp
@@ -1803,6 +1803,14 @@ static DynamicCastResult tryCastToExtendedExistential(
1803
selfType = metatypeMetadata->InstanceType;
1804
node = node->getChild(0)->getChild(0);
1805
}
1806
+
1807
+ // Make sure the thing we've pulled out at the end is a dependent
1808
+ // generic parameter.
1809
+ if (!(node->getKind() == Demangle::Node::Kind::Type &&
1810
+ node->getNumChildren() &&
1811
+ node->getChild(0)->getKind() ==
1812
+ Demangle::Node::Kind::DependentGenericParamType))
1813
+ return DynamicCastResult::Failure;
1814
1815
1816
llvm::SmallVector<const void *, 8> allGenericArgsVec;
0 commit comments