Skip to content

Commit

Permalink
Remove diag::descriptive_decl_declared_here
Browse files Browse the repository at this point in the history
It was used in one place to handle accessors, which happily is no longer necessary.
  • Loading branch information
beccadax committed Jul 1, 2023
1 parent f3dcacc commit 71bca16
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
2 changes: 0 additions & 2 deletions include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ NOTE(name_declared_here,none,
"%0 declared here", (DeclName))
NOTE(kind_declared_here,none,
"%0 declared here", (DescriptiveDeclKind))
NOTE(descriptive_decl_declared_here,none,
"'%0' declared here", (StringRef))
NOTE(implicit_member_declared_here,none,
"%kindbase0 is implicitly declared", (const ValueDecl *))
NOTE(extended_type_declared_here,none,
Expand Down
10 changes: 1 addition & 9 deletions lib/Sema/TypeCheckAvailability.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3573,15 +3573,7 @@ diagnoseDeclAsyncAvailability(const ValueDecl *D, SourceRange R,
if (const AbstractFunctionDecl *asyncAlt = afd->getAsyncAlternative()) {
SourceLoc diagLoc = call ? call->getLoc() : R.Start;
ctx.Diags.diagnose(diagLoc, diag::warn_use_async_alternative);
if (auto *accessor = dyn_cast<AccessorDecl>(asyncAlt)) {
SmallString<32> name;
llvm::raw_svector_ostream os(name);
accessor->printUserFacingName(os);
ctx.Diags.diagnose(asyncAlt->getLoc(),
diag::descriptive_decl_declared_here, name);
} else {
asyncAlt->diagnose(diag::decl_declared_here, asyncAlt);
}
asyncAlt->diagnose(diag::decl_declared_here, asyncAlt);
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/attr/attr_availability_async_rename.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ struct SomeStruct {
// expected-note@+1 2 {{'staticStructFunc()' declared here}}
static func staticStructFunc() async { }

// expected-note@+1 3 {{'getter:instanceProp()' declared here}}
// expected-note@+1 3 {{getter for 'instanceProp' declared here}}
var instanceProp: Int { get async { 1 } }
var regInstanceProp: Int { get { 1 } set { } }
// expected-note@+1 {{'getter:classProp()' declared here}}
// expected-note@+1 {{getter for 'classProp' declared here}}
static var classProp: Int { get async { 1 } }

@available(*, renamed: "getter:instanceProp()")
Expand Down

0 comments on commit 71bca16

Please sign in to comment.