@@ -2837,7 +2837,6 @@ AllMembersRequest::evaluate(
2837
2837
}
2838
2838
2839
2839
bool TypeChecker::isPassThroughTypealias (TypeAliasDecl *typealias,
2840
- Type underlyingType,
2841
2840
NominalTypeDecl *nominal) {
2842
2841
// Pass-through only makes sense when the typealias refers to a nominal
2843
2842
// type.
@@ -2872,7 +2871,8 @@ bool TypeChecker::isPassThroughTypealias(TypeAliasDecl *typealias,
2872
2871
// If neither is generic at this level, we have a pass-through typealias.
2873
2872
if (!typealias->isGeneric ()) return true ;
2874
2873
2875
- auto boundGenericType = underlyingType->getAs <BoundGenericType>();
2874
+ auto boundGenericType = typealias->getUnderlyingType ()
2875
+ ->getAs <BoundGenericType>();
2876
2876
if (!boundGenericType) return false ;
2877
2877
2878
2878
// If our arguments line up with our innermost generic parameters, it's
@@ -2919,24 +2919,13 @@ ExtendedTypeRequest::evaluate(Evaluator &eval, ExtensionDecl *ext) const {
2919
2919
// Hack to allow extending a generic typealias.
2920
2920
if (auto *unboundGeneric = extendedType->getAs <UnboundGenericType>()) {
2921
2921
if (auto *aliasDecl = dyn_cast<TypeAliasDecl>(unboundGeneric->getDecl ())) {
2922
- // Nested Hack to break cycles if this is called before validation has
2923
- // finished.
2924
- if (aliasDecl->hasInterfaceType ()) {
2925
- auto extendedNominal =
2926
- aliasDecl->getDeclaredInterfaceType ()->getAnyNominal ();
2927
- if (extendedNominal)
2928
- return TypeChecker::isPassThroughTypealias (
2929
- aliasDecl, aliasDecl->getUnderlyingType (), extendedNominal)
2930
- ? extendedType
2931
- : extendedNominal->getDeclaredType ();
2932
- } else {
2933
- if (auto ty = aliasDecl->getStructuralType ()
2934
- ->getAs <NominalOrBoundGenericNominalType>())
2935
- return TypeChecker::isPassThroughTypealias (aliasDecl, ty,
2936
- ty->getDecl ())
2937
- ? extendedType
2938
- : ty->getDecl ()->getDeclaredType ();
2939
- }
2922
+ auto extendedNominal =
2923
+ aliasDecl->getUnderlyingType ()->getAnyNominal ();
2924
+ if (extendedNominal)
2925
+ return TypeChecker::isPassThroughTypealias (
2926
+ aliasDecl, extendedNominal)
2927
+ ? extendedType
2928
+ : extendedNominal->getDeclaredType ();
2940
2929
}
2941
2930
}
2942
2931
0 commit comments