@@ -149,72 +149,6 @@ void GenericTypeToArchetypeResolver::recordParamType(ParamDecl *decl, Type type)
149149 type));
150150}
151151
152- Type PartialGenericTypeToArchetypeResolver::resolveGenericTypeParamType (
153- GenericTypeParamType *gp) {
154- auto gpDecl = gp->getDecl ();
155- if (!gpDecl)
156- return Type (gp);
157-
158- // Hack: See parseGenericParameters(). When the issue there is fixed,
159- // we won't need the isInvalid() check anymore.
160- if (gpDecl->isInvalid ())
161- return ErrorType::get (gpDecl->getASTContext ());
162-
163- if (!gpDecl->getDeclContext ()->isValidGenericContext ())
164- return Type (gp);
165-
166- auto *genericEnv = gpDecl->getDeclContext ()->getGenericEnvironmentOfContext ();
167- return genericEnv->mapTypeIntoContext (gp);
168- }
169-
170- Type PartialGenericTypeToArchetypeResolver::resolveDependentMemberType (
171- Type baseTy,
172- DeclContext *DC,
173- SourceRange baseRange,
174- ComponentIdentTypeRepr *ref) {
175- // We don't have enough information to find the associated type.
176- // FIXME: Nonsense, but we shouldn't need this code anyway.
177- return DependentMemberType::get (baseTy, ref->getIdentifier ());
178- }
179-
180- Type PartialGenericTypeToArchetypeResolver::resolveSelfAssociatedType (
181- Type selfTy,
182- DeclContext *DC,
183- AssociatedTypeDecl *assocType) {
184- // We don't have enough information to find the associated type.
185- // FIXME: Nonsense, but we shouldn't need this code anyway.
186- return DependentMemberType::get (selfTy, assocType);
187- }
188-
189- Type
190- PartialGenericTypeToArchetypeResolver::resolveTypeOfContext (DeclContext *dc,
191- bool wantSelf) {
192- if (dc->isGenericContext () && dc->isValidGenericContext ())
193- return dc->mapTypeIntoContext (getTypeOfContext (dc, wantSelf));
194- return getTypeOfContext (dc, wantSelf);
195- }
196-
197- Type
198- PartialGenericTypeToArchetypeResolver::resolveTypeOfDecl (TypeDecl *decl) {
199- // Hack for 'out of context' GenericTypeParamDecls when resolving
200- // a generic typealias
201- if (auto *paramDecl = dyn_cast<GenericTypeParamDecl>(decl)) {
202- return decl->getDeclContext ()->getGenericEnvironmentOfContext ()
203- ->mapTypeIntoContext (paramDecl->getDeclaredInterfaceType ()
204- ->castTo <GenericTypeParamType>());
205- }
206-
207- auto *aliasDecl = cast<TypeAliasDecl>(decl);
208- if (aliasDecl->isInvalid ())
209- return ErrorType::get (aliasDecl->getASTContext ());
210- return aliasDecl->getAliasType ();
211- }
212-
213- void
214- PartialGenericTypeToArchetypeResolver::recordParamType (ParamDecl *decl, Type type) {
215- // Do nothing
216- }
217-
218152Type CompleteGenericTypeResolver::resolveGenericTypeParamType (
219153 GenericTypeParamType *gp) {
220154 auto gpDecl = gp->getDecl ();
0 commit comments