File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -2953,9 +2953,9 @@ bool ContextualFailure::tryTypeCoercionFixIt(
2953
2953
if (!toType->hasTypeRepr ())
2954
2954
return false ;
2955
2955
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.
2959
2959
if (!bothOptional && fromType->getOptionalObjectType ()) {
2960
2960
if (TypeChecker::isSubtypeOf (fromType->lookThroughAllOptionalTypes (),
2961
2961
toType, getDC ())) {
Original file line number Diff line number Diff line change @@ -6735,7 +6735,7 @@ static ConstraintFix *maybeWarnAboutExtraneousCast(
6735
6735
// we need to store the difference as a signed integer.
6736
6736
int extraOptionals = fromOptionals.size () - toOptionals.size ();
6737
6737
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
6739
6739
// restrictions that we have to account for optionality mismatch.
6740
6740
const auto subExprType = cs.getType (castExpr->getSubExpr ());
6741
6741
if (llvm::any_of (constraintRestrictions, [&](auto &entry) {
You can’t perform that action at this time.
0 commit comments