Skip to content

Commit 8bd3e2d

Browse files
authored
[AutoDiff] Upstream minor changes from tensorflow branch. (#29018)
Upstream derivative function lookup changes from #28935.
1 parent 36fff23 commit 8bd3e2d

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

lib/Sema/TypeCheckAttr.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3182,20 +3182,15 @@ static AbstractFunctionDecl *findAbstractFunctionDecl(
31823182

31833183
// Perform lookup.
31843184
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();
31853189
if (baseType) {
31863190
results = TypeChecker::lookupMember(lookupContext, baseType, funcName);
31873191
} else {
31883192
results = TypeChecker::lookupUnqualified(lookupContext, funcName,
31893193
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-
}
31993194
}
32003195

32013196
// Initialize error flags.

0 commit comments

Comments
 (0)