File tree 1 file changed +5
-11
lines changed
1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -259,19 +259,13 @@ void CompletionLookup::foundFunction(const AnyFunctionType *AFT) {
259
259
260
260
bool CompletionLookup::canBeUsedAsRequirementFirstType (Type selfTy,
261
261
TypeAliasDecl *TAD) {
262
- auto T = TAD->getDeclaredInterfaceType ();
263
- auto subMap = selfTy->getMemberSubstitutionMap (TAD);
264
- T = T.subst (subMap)->getCanonicalType ();
265
-
266
- ArchetypeType *archeTy = T->getAs <ArchetypeType>();
267
- if (!archeTy)
262
+ if (TAD->isGeneric ())
268
263
return false ;
269
- archeTy = archeTy->getRoot ();
270
264
271
- // For protocol, the 'archeTy' should match with the 'baseTy' which is the
272
- // dynamic 'Self' type of the protocol. For nominal decls, 'archTy' should
273
- // be one of the generic params in 'selfTy'. Search 'archeTy' in 'baseTy'.
274
- return selfTy. findIf ([&](Type T) { return archeTy-> isEqual (T); } );
265
+ auto T = TAD-> getDeclaredInterfaceType ();
266
+ auto subMap = selfTy-> getContextSubstitutionMap (TAD-> getDeclContext ());
267
+
268
+ return T. subst (subMap)-> is <ArchetypeType>( );
275
269
}
276
270
277
271
CompletionLookup::CompletionLookup (CodeCompletionResultSink &Sink,
You can’t perform that action at this time.
0 commit comments