File tree Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -124,14 +124,16 @@ void ConformingMethodListCallbacks::doneParsing(SourceFile *SrcFile) {
124
124
return ;
125
125
126
126
T = T->getRValueType ();
127
- if (T->hasArchetype ())
128
- T = T->mapTypeOutOfContext ();
129
127
130
128
// If there are no (instance) members for this type, bail.
131
129
if (!T->mayHaveMembers () || T->is <ModuleType>()) {
132
130
return ;
133
131
}
134
132
133
+ auto interfaceTy = T;
134
+ if (T->hasArchetype ())
135
+ interfaceTy = interfaceTy->mapTypeOutOfContext ();
136
+
135
137
llvm::SmallPtrSet<ProtocolDecl*, 8 > expectedProtocols;
136
138
for (auto Name: ExpectedTypeNames) {
137
139
if (auto *PD = resolveProtocolName (CurDeclContext, Name)) {
@@ -140,7 +142,7 @@ void ConformingMethodListCallbacks::doneParsing(SourceFile *SrcFile) {
140
142
}
141
143
142
144
// Collect the matching methods.
143
- ConformingMethodListResult result (CurDeclContext, T );
145
+ ConformingMethodListResult result (CurDeclContext, interfaceTy );
144
146
getMatchingMethods (T, expectedProtocols, result.Members );
145
147
146
148
Consumer.handleResult (result);
Original file line number Diff line number Diff line change @@ -133,21 +133,19 @@ void ContextInfoCallbacks::doneParsing(SourceFile *SrcFile) {
133
133
continue ;
134
134
135
135
T = T->getRValueType ();
136
- if (T->hasArchetype ())
137
- T = T->mapTypeOutOfContext ();
138
136
139
- // TODO: Do we need '.none' for Optionals?
140
- auto objT = T->lookThroughAllOptionalTypes ();
141
-
142
- if (auto env = CurDeclContext->getGenericEnvironmentOfContext ())
143
- objT = env->mapTypeIntoContext (T);
137
+ auto interfaceTy = T;
138
+ if (interfaceTy->hasArchetype ())
139
+ interfaceTy = interfaceTy->mapTypeOutOfContext ();
144
140
145
- if (!seenTypes.insert (objT->getCanonicalType ()).second )
141
+ // TODO: Do we need '.none' for Optionals?
142
+ auto objTy = T->lookThroughAllOptionalTypes ();
143
+ if (!seenTypes.insert (objTy->getCanonicalType ()).second )
146
144
continue ;
147
145
148
- results.emplace_back (T );
146
+ results.emplace_back (interfaceTy );
149
147
auto &item = results.back ();
150
- getImplicitMembers (objT , item.ImplicitMembers );
148
+ getImplicitMembers (objTy , item.ImplicitMembers );
151
149
}
152
150
153
151
Consumer.handleResults (results);
You can’t perform that action at this time.
0 commit comments