File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -3195,23 +3195,15 @@ static AbstractFunctionDecl *findAbstractFunctionDecl(
3195
3195
3196
3196
// Perform lookup.
3197
3197
LookupResult results;
3198
+ // If `baseType` is not null but `lookupContext` is a type context, set
3199
+ // `baseType` to the `self` type of `lookupContext` to perform member lookup.
3200
+ if (!baseType && lookupContext->isTypeContext ())
3201
+ baseType = lookupContext->getSelfTypeInContext ();
3198
3202
if (baseType) {
3199
3203
results = TypeChecker::lookupMember (lookupContext, baseType, funcName);
3200
- } else if (auto *typeDecl = lookupContext->getSelfNominalTypeDecl ()) {
3201
- results = TypeChecker::lookupMember (lookupContext,
3202
- typeDecl->getDeclaredType (), funcName);
3203
3204
} else {
3204
3205
results = TypeChecker::lookupUnqualified (lookupContext, funcName,
3205
3206
funcNameLoc, lookupOptions);
3206
-
3207
- // If looking up an operator within a type context, look specifically within
3208
- // the type context.
3209
- // This tries to resolve unqualified operators, like `+`.
3210
- if (funcName.isOperator () && lookupContext->isTypeContext ()) {
3211
- if (auto tmp = TypeChecker::lookupMember (
3212
- lookupContext, lookupContext->getSelfTypeInContext (), funcName))
3213
- results = tmp;
3214
- }
3215
3207
}
3216
3208
3217
3209
// Initialize error flags.
You can’t perform that action at this time.
0 commit comments