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:
@@ -1259,7 +1259,7 @@ bool RValueTreatedAsLValueFailure::diagnoseAsError() {
|
||||
emitDiagnostic(loc, diag::assignment_let_property_delegating_init,
|
||||
member->getName());
|
||||
if (auto *ref = getResolvedMemberRef(member)) {
|
||||
emitDiagnostic(ref, diag::decl_declared_here, member->getName());
|
||||
emitDiagnostic(ref, diag::decl_declared_here, ref->getFullName());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -3042,7 +3042,7 @@ bool SubscriptMisuseFailure::diagnoseAsNote() {
|
||||
/// meaning their lower case counterparts are identical.
|
||||
/// - DeclName is valid when such a correct case is found; invalid otherwise.
|
||||
DeclName MissingMemberFailure::findCorrectEnumCaseName(
|
||||
Type Ty, TypoCorrectionResults &corrections, DeclName memberName) {
|
||||
Type Ty, TypoCorrectionResults &corrections, DeclNameRef memberName) {
|
||||
if (memberName.isSpecial() || !memberName.isSimpleName())
|
||||
return DeclName();
|
||||
if (!Ty->getEnumOrBoundGenericEnum())
|
||||
@@ -3146,10 +3146,9 @@ bool MissingMemberFailure::diagnoseAsError() {
|
||||
getName().getBaseName() == DeclBaseName::createConstructor()) {
|
||||
auto &cs = getConstraintSystem();
|
||||
|
||||
auto memberName = getName().getBaseName();
|
||||
auto result = cs.performMemberLookup(
|
||||
ConstraintKind::ValueMember, memberName, metatypeTy,
|
||||
FunctionRefKind::DoubleApply, getLocator(),
|
||||
ConstraintKind::ValueMember, getName().withoutArgumentLabels(),
|
||||
metatypeTy, FunctionRefKind::DoubleApply, getLocator(),
|
||||
/*includeInaccessibleMembers=*/true);
|
||||
|
||||
// If there are no `init` members at all produce a tailored
|
||||
@@ -3470,10 +3469,10 @@ bool AllowTypeOrInstanceMemberFailure::diagnoseAsError() {
|
||||
// static members doesn't make a whole lot of sense
|
||||
if (auto TAD = dyn_cast<TypeAliasDecl>(Member)) {
|
||||
Diag.emplace(emitDiagnostic(loc, diag::typealias_outside_of_protocol,
|
||||
TAD->getName()));
|
||||
Name));
|
||||
} else if (auto ATD = dyn_cast<AssociatedTypeDecl>(Member)) {
|
||||
Diag.emplace(emitDiagnostic(loc, diag::assoc_type_outside_of_protocol,
|
||||
ATD->getName()));
|
||||
Name));
|
||||
} else if (isa<ConstructorDecl>(Member)) {
|
||||
Diag.emplace(emitDiagnostic(loc, diag::construct_protocol_by_name,
|
||||
instanceTy));
|
||||
|
||||
Reference in New Issue
Block a user