@@ -1211,54 +1211,6 @@ namespace {
12111211 locator);
12121212 }
12131213
1214- AutoClosureExpr *buildCurryThunk (ValueDecl *member,
1215- FunctionType *selfFnTy,
1216- Expr *selfParamRef,
1217- Expr *ref,
1218- ConstraintLocatorBuilder locator) {
1219- auto &context = cs.getASTContext ();
1220-
1221- auto resultTy = selfFnTy->getResult ();
1222-
1223- auto refTy = cs.getType (ref)->castTo <FunctionType>();
1224-
1225- auto selfParam = refTy->getParams ()[0 ];
1226- auto selfParamTy = selfParam.getPlainType ();
1227-
1228- Expr *selfOpenedRef = selfParamRef;
1229-
1230- if (selfParamTy->hasOpenedExistential ()) {
1231- // If we're opening an existential:
1232- // - the type of 'ref' inside the closure is written in terms of the
1233- // open existental archetype
1234- // - the type of the closure, 'selfFnTy' is written in terms of the
1235- // erased existential bounds
1236- if (selfParam.isInOut ())
1237- selfParamTy = LValueType::get (selfParamTy);
1238-
1239- selfOpenedRef =
1240- new (context) OpaqueValueExpr (SourceLoc (), selfParamTy);
1241- cs.cacheType (selfOpenedRef);
1242- }
1243-
1244- // FIXME: selfParamRef ownership
1245-
1246- auto *const thunk = buildSingleCurryThunk (
1247- selfOpenedRef, ref, cast<DeclContext>(member), selfFnTy, locator);
1248-
1249- if (selfParam.getPlainType ()->hasOpenedExistential ()) {
1250- auto *body = thunk->getSingleExpressionBody ();
1251- body = new (context) OpenExistentialExpr (
1252- selfParamRef, cast<OpaqueValueExpr>(selfOpenedRef), body,
1253- resultTy);
1254- cs.cacheType (body);
1255-
1256- thunk->setBody (body);
1257- }
1258-
1259- return thunk;
1260- }
1261-
12621214 // / Build a "{ self in { args in self.fn(args) } }" nested curry thunk.
12631215 // /
12641216 // / \param memberRef The expression to be called in the inner thunk by
0 commit comments