Skip to content

[AutoDiff] Upstream minor changes from tensorflow branch. #29018

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions lib/Sema/TypeCheckAttr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3182,20 +3182,15 @@ static AbstractFunctionDecl *findAbstractFunctionDecl(

// Perform lookup.
LookupResult results;
// If `baseType` is not null but `lookupContext` is a type context, set
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: this change is mostly NFC. I failed to find a minimal reproducer for the fixed issue TF-1090 in #28935, though I didn't try very hard. I think no test on master is fine.

// `baseType` to the `self` type of `lookupContext` to perform member lookup.
if (!baseType && lookupContext->isTypeContext())
baseType = lookupContext->getSelfTypeInContext();
if (baseType) {
results = TypeChecker::lookupMember(lookupContext, baseType, funcName);
} else {
results = TypeChecker::lookupUnqualified(lookupContext, funcName,
funcNameLoc, lookupOptions);

// If looking up an operator within a type context, look specifically within
// the type context.
// This tries to resolve unqualified operators, like `+`.
if (funcName.isOperator() && lookupContext->isTypeContext()) {
if (auto tmp = TypeChecker::lookupMember(
lookupContext, lookupContext->getSelfTypeInContext(), funcName))
results = tmp;
}
}

// Initialize error flags.
Expand Down