Skip to content

Commit a05c34c

Browse files
committed
Fix typos in diagnostics
1 parent eae192f commit a05c34c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7902,14 +7902,14 @@ ERROR(lifetime_dependence_invalid_return_type, none,
79027902
ERROR(lifetime_dependence_cannot_infer_ambiguous_candidate, none,
79037903
"cannot infer lifetime dependence %0, multiple parameters qualifiy as a candidate", (StringRef))
79047904
ERROR(lifetime_dependence_cannot_infer_no_candidates, none,
7905-
"cannot infer lifetime dependence %0, no parameters found that are either "
7905+
"cannot infer lifetime dependence%0, no parameters found that are either "
79067906
"~Escapable or Escapable with a borrowing ownership", (StringRef))
79077907
ERROR(lifetime_dependence_ctor_non_self_or_nil_return, none,
79087908
"expected nil or self as return values in an initializer with "
79097909
"lifetime dependent specifiers",
79107910
())
79117911
ERROR(lifetime_dependence_on_bitwise_copyable, none,
7912-
"invalid lifetime dependence on bitwise copyable type", ())
7912+
"invalid lifetime dependence on BitwiseCopyable type", ())
79137913
ERROR(lifetime_dependence_cannot_be_applied_to_tuple_elt, none,
79147914
"lifetime dependence specifiers cannot be applied to tuple elements", ())
79157915
ERROR(lifetime_dependence_method_escapable_bitwisecopyable_self, none,

lib/AST/LifetimeDependence.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ static LifetimeDependenceKind getLifetimeDependenceKindFromDecl(
165165
return LifetimeDependenceKind::Scope;
166166
}
167167
if (parsedLifetimeDependenceKind == ParsedLifetimeDependenceKind::Inherit) {
168-
// TODO: assert that this can happen only on deserialized decls
168+
// TODO: assert that this can happen in SIL tests
169169
return LifetimeDependenceKind::Inherit;
170170
}
171171
return paramType->isEscapable() ? LifetimeDependenceKind::Scope
@@ -277,7 +277,7 @@ LifetimeDependenceInfo::fromTypeRepr(AbstractFunctionDecl *afd) {
277277
}
278278
case LifetimeDependenceSpecifier::SpecifierKind::Ordered: {
279279
auto index = specifier.getIndex();
280-
if (index > afd->getParameters()->size()) {
280+
if (index >= afd->getParameters()->size()) {
281281
diags.diagnose(specifier.getLoc(),
282282
diag::lifetime_dependence_invalid_param_index, index);
283283
return std::nullopt;
@@ -495,7 +495,7 @@ LifetimeDependenceInfo::infer(AbstractFunctionDecl *afd) {
495495
if (cd && afd->isImplicit()) {
496496
diags.diagnose(returnLoc,
497497
diag::lifetime_dependence_cannot_infer_no_candidates,
498-
"on implicit initializer");
498+
" on implicit initializer");
499499
return std::nullopt;
500500
}
501501
diags.diagnose(returnLoc,

0 commit comments

Comments
 (0)