mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[NFC] Thread DeclNameRef through most of the compiler
This huge commit contains as many of the mechanical changes as possible.
This commit is contained in:
@@ -232,7 +232,7 @@ getDynamicResultSignature(ValueDecl *decl) {
|
||||
llvm_unreachable("Not a valid @objc member");
|
||||
}
|
||||
|
||||
LookupResult &ConstraintSystem::lookupMember(Type base, DeclName name) {
|
||||
LookupResult &ConstraintSystem::lookupMember(Type base, DeclNameRef name) {
|
||||
// Check whether we've already performed this lookup.
|
||||
auto &result = MemberLookups[{base, name}];
|
||||
if (result) return *result;
|
||||
@@ -2048,8 +2048,10 @@ std::pair<Type, bool> ConstraintSystem::adjustTypeOfOverloadReference(
|
||||
// Attempt to lookup a member with a give name in the root type and
|
||||
// assign result to the leaf type of the keypath.
|
||||
bool isSubscriptRef = locator->isSubscriptMemberRef();
|
||||
DeclName memberName =
|
||||
isSubscriptRef ? DeclBaseName::createSubscript() : choice.getName();
|
||||
DeclNameRef memberName = isSubscriptRef
|
||||
? DeclNameRef::createSubscript()
|
||||
// FIXME: Should propagate name-as-written through.
|
||||
: DeclNameRef_(choice.getName());
|
||||
|
||||
auto *memberRef = Constraint::createMember(
|
||||
*this, ConstraintKind::ValueMember, LValueType::get(rootTy), memberTy,
|
||||
@@ -2958,7 +2960,9 @@ bool ConstraintSystem::diagnoseAmbiguity(ArrayRef<Solution> solutions) {
|
||||
// depth-first numbering of expressions.
|
||||
if (bestOverload) {
|
||||
auto &overload = diff.overloads[*bestOverload];
|
||||
auto name = getOverloadChoiceName(overload.choices);
|
||||
// FIXME: We would prefer to emit the name as written, but that information
|
||||
// is not sufficiently centralized in the AST.
|
||||
auto name = DeclNameRef_(getOverloadChoiceName(overload.choices));
|
||||
auto anchor = simplifyLocatorToAnchor(overload.locator);
|
||||
|
||||
// Emit the ambiguity diagnostic.
|
||||
|
||||
Reference in New Issue
Block a user