File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -3184,6 +3184,21 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
3184
3184
3185
3185
this ->ExprType = ExprType;
3186
3186
3187
+ // Open existential types, so that lookupVisibleMemberDecls() can properly
3188
+ // substitute them.
3189
+ bool WasOptional = false ;
3190
+ if (auto OptionalType = ExprType->getOptionalObjectType ()) {
3191
+ ExprType = OptionalType;
3192
+ WasOptional = true ;
3193
+ }
3194
+
3195
+ if (!ExprType->getMetatypeInstanceType ()->isAnyObject ())
3196
+ if (ExprType->isAnyExistentialType ())
3197
+ ExprType = ArchetypeType::getAnyOpened (ExprType);
3198
+
3199
+ if (WasOptional)
3200
+ ExprType = OptionalType::get (ExprType);
3201
+
3187
3202
// Handle special cases
3188
3203
bool isIUO = VD && VD->getAttrs ()
3189
3204
.hasAttribute <ImplicitlyUnwrappedOptionalAttr>();
You can’t perform that action at this time.
0 commit comments