File tree Expand file tree Collapse file tree 1 file changed +1
-20
lines changed Expand file tree Collapse file tree 1 file changed +1
-20
lines changed Original file line number Diff line number Diff line change @@ -7980,26 +7980,7 @@ ExprRewriter::coerceSelfArgumentToType(Expr *expr,
7980
7980
Type baseTy, ValueDecl *member,
7981
7981
ConstraintLocatorBuilder locator) {
7982
7982
Type toType = adjustSelfTypeForMember (expr, baseTy, member, dc);
7983
-
7984
- // If our expression already has the right type, we're done.
7985
- Type fromType = cs.getType (expr);
7986
- if (fromType->isEqual (toType))
7987
- return expr;
7988
-
7989
- // If we're coercing to an rvalue type, just do it.
7990
- auto toInOutTy = toType->getAs <InOutType>();
7991
- if (!toInOutTy)
7992
- return coerceToType (expr, toType, locator);
7993
-
7994
- assert (fromType->is <LValueType>() && " Can only convert lvalues to inout" );
7995
-
7996
- auto &ctx = cs.getASTContext ();
7997
-
7998
- // Use InOutExpr to convert it to an explicit inout argument for the
7999
- // receiver.
8000
- return cs.cacheType (new (ctx) InOutExpr (expr->getStartLoc (), expr,
8001
- toInOutTy->getInOutObjectType (),
8002
- /* isImplicit*/ true ));
7983
+ return coerceToType (expr, toType, locator);
8003
7984
}
8004
7985
8005
7986
Expr *ExprRewriter::convertLiteralInPlace (
You can’t perform that action at this time.
0 commit comments