Skip to content

Commit 4e689bb

Browse files
[NFC] Adjusting comments for clarity
1 parent b517ed3 commit 4e689bb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/Sema/CSDiagnostics.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2953,9 +2953,9 @@ bool ContextualFailure::tryTypeCoercionFixIt(
29532953
if (!toType->hasTypeRepr())
29542954
return false;
29552955

2956-
// If optional unwrapped type is a subtype of the specified contextual type,
2957-
// let's suggest a force unwrap "!". Otherwise fallback to potential coercion
2958-
// or force cast.
2956+
// If object of the optional type is a subtype of the specified contextual
2957+
// type, let's suggest a force unwrap "!". Otherwise fallback to potential
2958+
// coercion or force cast.
29592959
if (!bothOptional && fromType->getOptionalObjectType()) {
29602960
if (TypeChecker::isSubtypeOf(fromType->lookThroughAllOptionalTypes(),
29612961
toType, getDC())) {

lib/Sema/CSSimplify.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6735,7 +6735,7 @@ static ConstraintFix *maybeWarnAboutExtraneousCast(
67356735
// we need to store the difference as a signed integer.
67366736
int extraOptionals = fromOptionals.size() - toOptionals.size();
67376737

6738-
// From expression could be a type variable with a value to optional
6738+
// "from" expression could be a type variable with value-to-optional
67396739
// restrictions that we have to account for optionality mismatch.
67406740
const auto subExprType = cs.getType(castExpr->getSubExpr());
67416741
if (llvm::any_of(constraintRestrictions, [&](auto &entry) {

0 commit comments

Comments
 (0)