@@ -120,47 +120,6 @@ operator()(InFlightSubstitution &IFS, Type dependentType,
120120 return ProtocolConformanceRef::forInvalid ();
121121}
122122
123- ProtocolConformanceRef MakeAbstractConformanceForGenericType::
124- operator ()(InFlightSubstitution &IFS, Type dependentType,
125- ProtocolDecl *conformedProtocol) const {
126- auto getConformance = [&](Type conformingReplacementType) {
127- if (conformingReplacementType->is <ErrorType>())
128- return ProtocolConformanceRef::forInvalid ();
129-
130- // A class-constrained archetype might conform to the protocol
131- // concretely.
132- if (auto *archetypeType = conformingReplacementType->getAs <ArchetypeType>()) {
133- if (archetypeType->getSuperclass ()) {
134- return lookupConformance (archetypeType, conformedProtocol);
135- }
136- }
137-
138- return ProtocolConformanceRef::forAbstract (
139- conformingReplacementType, conformedProtocol);
140- };
141-
142- // FIXME: Don't recompute this every time.
143- auto conformingReplacementType = dependentType.subst (IFS);
144-
145- // The places that use this can also produce conformance packs, generally
146- // just for singleton pack expansions.
147- if (auto conformingPack = conformingReplacementType->getAs <PackType>()) {
148- SmallVector<ProtocolConformanceRef, 4 > conformances;
149- for (auto conformingPackElt : conformingPack->getElementTypes ()) {
150- // Look through pack expansions; there's no equivalent conformance
151- // expansion right now.
152- if (auto expansion = conformingPackElt->getAs <PackExpansionType>())
153- conformingPackElt = expansion->getPatternType ();
154-
155- conformances.push_back (getConformance (conformingPackElt));
156- }
157- return ProtocolConformanceRef (
158- PackConformance::get (conformingPack, conformedProtocol, conformances));
159- }
160-
161- return getConformance (conformingReplacementType);
162- }
163-
164123InFlightSubstitution::InFlightSubstitution (TypeSubstitutionFn substType,
165124 LookupConformanceFn lookupConformance,
166125 SubstOptions options)
0 commit comments