Skip to content

Commit db41dcf

Browse files
[Sema] Correcting comments typos
1 parent f620f76 commit db41dcf

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

lib/Sema/CSBindings.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,8 +1224,8 @@ bool TypeVariableBinding::attempt(ConstraintSystem &cs) const {
12241224
} else if (srcLocator->directlyAt<ObjectLiteralExpr>()) {
12251225
fix = SpecifyObjectLiteralTypeImport::create(cs, dstLocator);
12261226
} else if (srcLocator->isKeyPathRoot()) {
1227-
// If we recorded a invalid key path fix, let's skip this root fix
1228-
// because it wouldn't produce a useful diagnostic.
1227+
// If we recorded an invalid key path fix, let's skip this specify root
1228+
// type fix because it wouldn't produce a useful diagnostic.
12291229
auto *kpLocator = cs.getConstraintLocator(srcLocator->getAnchor());
12301230
if (cs.hasFixFor(kpLocator, FixKind::AllowKeyPathWithoutComponents))
12311231
return true;

lib/Sema/CSDiagnostics.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6766,9 +6766,9 @@ bool InvalidEmptyKeyPathFailure::diagnoseAsError() {
67666766
assert(KPE && KPE->hasSingleInvalidComponent() &&
67676767
"Expected a malformed key path expression");
67686768

6769-
// String interpolation represented as key path expressions e.g. \(x),
6770-
// \(x, a: 1) and this is already diagnosed. So let's skip it because
6771-
// that is not the case for a empty key path diagnostic.
6769+
// If we have a string interpolation represented as key path expressions
6770+
// e.g. \(x), \(x, a: 1). Let's skip it because this would be already
6771+
// diagnosed and it is not the case for an extra empty key path diagnostic.
67726772
auto *root = KPE->getParsedRoot();
67736773
if (root && (isa<ParenExpr>(root) || isa<TupleExpr>(root)))
67746774
return true;

lib/Sema/CSDiagnostics.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2248,7 +2248,7 @@ class TrailingClosureRequiresExplicitLabel final : public FailureDiagnostic {
22482248
const FunctionArgApplyInfo &info) const;
22492249
};
22502250

2251-
/// Diagnose situations where we have key path missing a component.
2251+
/// Diagnose situations where we have a key path with no components.
22522252
///
22532253
/// \code
22542254
/// let _ : KeyPath<A, B> = \A

lib/Sema/CSFix.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ enum class FixKind : uint8_t {
274274
/// parameter in the call.
275275
SpecifyLabelToAssociateTrailingClosure,
276276

277-
/// Allow key path expressions missing component.
277+
/// Allow key path expressions with no components.
278278
AllowKeyPathWithoutComponents,
279279
};
280280

@@ -1961,7 +1961,7 @@ class SpecifyLabelToAssociateTrailingClosure final : public ConstraintFix {
19611961
create(ConstraintSystem &cs, ConstraintLocator *locator);
19621962
};
19631963

1964-
/// Diagnose situations where we have key path missing a component.
1964+
/// Diagnose situations where we have a key path with no components.
19651965
///
19661966
/// \code
19671967
/// let _ : KeyPath<A, B> = \A

0 commit comments

Comments
 (0)