Skip to content

Commit 67a22aa

Browse files
committed
Sema: Remove unnecessary AtRethrows diagnostic
The attribute is already declared OnProtocol only, so this diagnostic is unreachable.
1 parent 18084ee commit 67a22aa

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2994,8 +2994,6 @@ ERROR(override_rethrows_with_non_rethrows,none,
29942994
"be 'rethrows'", (bool))
29952995
ERROR(rethrows_without_throwing_parameter,none,
29962996
"'rethrows' function must take a throwing function argument", ())
2997-
ERROR(rethrows_attr_on_non_protocol,none,
2998-
"@rethrows may only be used on 'protocol' declarations", ())
29992997

30002998
ERROR(autoclosure_function_type,none,
30012999
"@autoclosure attribute only applies to function types",

lib/Sema/TypeCheckAttr.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2062,14 +2062,7 @@ void AttributeChecker::visitRethrowsAttr(RethrowsAttr *attr) {
20622062
attr->setInvalid();
20632063
}
20642064

2065-
void AttributeChecker::visitAtRethrowsAttr(AtRethrowsAttr *attr) {
2066-
if (isa<ProtocolDecl>(D)) {
2067-
return;
2068-
}
2069-
2070-
diagnose(attr->getLocation(), diag::rethrows_attr_on_non_protocol);
2071-
attr->setInvalid();
2072-
}
2065+
void AttributeChecker::visitAtRethrowsAttr(AtRethrowsAttr *attr) {}
20732066

20742067
/// Collect all used generic parameter types from a given type.
20752068
static void collectUsedGenericParameters(

0 commit comments

Comments
 (0)