File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -3182,20 +3182,15 @@ static AbstractFunctionDecl *findAbstractFunctionDecl(
3182
3182
3183
3183
// Perform lookup.
3184
3184
LookupResult results;
3185
+ // If `baseType` is not null but `lookupContext` is a type context, set
3186
+ // `baseType` to the `self` type of `lookupContext` to perform member lookup.
3187
+ if (!baseType && lookupContext->isTypeContext ())
3188
+ baseType = lookupContext->getSelfTypeInContext ();
3185
3189
if (baseType) {
3186
3190
results = TypeChecker::lookupMember (lookupContext, baseType, funcName);
3187
3191
} else {
3188
3192
results = TypeChecker::lookupUnqualified (lookupContext, funcName,
3189
3193
funcNameLoc, lookupOptions);
3190
-
3191
- // If looking up an operator within a type context, look specifically within
3192
- // the type context.
3193
- // This tries to resolve unqualified operators, like `+`.
3194
- if (funcName.isOperator () && lookupContext->isTypeContext ()) {
3195
- if (auto tmp = TypeChecker::lookupMember (
3196
- lookupContext, lookupContext->getSelfTypeInContext (), funcName))
3197
- results = tmp;
3198
- }
3199
3194
}
3200
3195
3201
3196
// Initialize error flags.
You can’t perform that action at this time.
0 commit comments