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(
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 ())) {
Original file line number Diff line number Diff 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) {
You can’t perform that action at this time.
0 commit comments