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