Skip to content

Commit 836a81e

Browse files
authored
Merge pull request swiftlang#36203 from xwu/default-accessor-error-gardening
2 parents 80b1d53 + ce3334d commit 836a81e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

include/swift/AST/DiagnosticsParse.def

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ ERROR(computed_property_no_accessors, none,
249249
ERROR(expected_getset_in_protocol,none,
250250
"expected get or set in a protocol property", ())
251251
ERROR(unexpected_getset_implementation_in_protocol,none,
252-
"protocol property %0 cannot have a default implementation specified here; use extension instead", (StringRef))
252+
"protocol property %0 cannot have a default implementation specified "
253+
"here; use extension instead", (StringRef))
253254
ERROR(computed_property_missing_type,none,
254255
"computed property must have an explicit type", ())
255256
ERROR(getset_nontrivial_pattern,none,

lib/Parse/ParseDecl.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6071,10 +6071,9 @@ ParserStatus Parser::parseGetSet(ParseDeclOptions Flags,
60716071
existingAccessor);
60726072
}
60736073

6074-
// There's should be no body in the limited syntax.
6074+
// There should be no body in the limited syntax; diagnose unexpected
6075+
// accessor implementations.
60756076
if (parsingLimitedSyntax) {
6076-
// If there ~is~ a body in the limited syntax, alert that accessors can not
6077-
// be implemented.
60786077
if (Tok.is(tok::l_brace))
60796078
diagnose(Tok, diag::unexpected_getset_implementation_in_protocol,
60806079
getAccessorNameForDiagnostic(Kind, /*article*/ false));

0 commit comments

Comments
 (0)