mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Push ArchetypeType's API down to subclasses.
And clean up code that conditionally works only with certain kinds of archetype along the way.
This commit is contained in:
@@ -2098,11 +2098,11 @@ bool Expr::isSelfExprOf(const AbstractFunctionDecl *AFD, bool sameBase) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
ArchetypeType *OpenExistentialExpr::getOpenedArchetype() const {
|
||||
OpenedArchetypeType *OpenExistentialExpr::getOpenedArchetype() const {
|
||||
auto type = getOpaqueValue()->getType()->getRValueType();
|
||||
while (auto metaTy = type->getAs<MetatypeType>())
|
||||
type = metaTy->getInstanceType();
|
||||
return type->castTo<ArchetypeType>();
|
||||
return type->castTo<OpenedArchetypeType>();
|
||||
}
|
||||
|
||||
KeyPathExpr::KeyPathExpr(ASTContext &C, SourceLoc keywordLoc,
|
||||
|
||||
Reference in New Issue
Block a user