File tree 1 file changed +1
-18
lines changed
1 file changed +1
-18
lines changed Original file line number Diff line number Diff line change @@ -7953,24 +7953,7 @@ ExprRewriter::coerceSelfArgumentToType(Expr *expr,
7953
7953
Type baseTy, ValueDecl *member,
7954
7954
ConstraintLocatorBuilder locator) {
7955
7955
Type toType = adjustSelfTypeForMember (expr, baseTy, member, dc);
7956
-
7957
- // If our expression already has the right type, we're done.
7958
- Type fromType = cs.getType (expr);
7959
- if (fromType->isEqual (toType))
7960
- return expr;
7961
-
7962
- // If we're coercing to an rvalue type, just do it.
7963
- auto toInOutTy = toType->getAs <InOutType>();
7964
- if (!toInOutTy)
7965
- return coerceToType (expr, toType, locator);
7966
-
7967
- assert (fromType->is <LValueType>() && " Can only convert lvalues to inout" );
7968
-
7969
- // Use InOutExpr to convert it to an explicit inout argument for the
7970
- // receiver.
7971
- return cs.cacheType (new (ctx) InOutExpr (expr->getStartLoc (), expr,
7972
- toInOutTy->getInOutObjectType (),
7973
- /* isImplicit*/ true ));
7956
+ return coerceToType (expr, toType, locator);
7974
7957
}
7975
7958
7976
7959
Expr *ExprRewriter::convertLiteralInPlace (
You can’t perform that action at this time.
0 commit comments