@@ -378,7 +378,6 @@ namespace {
378
378
llvm::DenseMap<Expr*, Type> ExprTypes;
379
379
llvm::DenseMap<TypeLoc*, Type> TypeLocTypes;
380
380
llvm::DenseMap<Pattern*, Type> PatternTypes;
381
- llvm::DenseMap<ParamDecl*, Type> ParamDeclInterfaceTypes;
382
381
ExprTypeSaverAndEraser (const ExprTypeSaverAndEraser&) = delete ;
383
382
void operator =(const ExprTypeSaverAndEraser&) = delete ;
384
383
public:
@@ -417,17 +416,6 @@ namespace {
417
416
if (isa<LiteralExpr>(expr) && !isa<InterpolatedStringLiteralExpr>(expr) &&
418
417
!(expr->getType () && expr->getType ()->hasError ()))
419
418
return { false , expr };
420
-
421
- // If a ClosureExpr's parameter list has types on the decls, then
422
- // remove them so that they'll get regenerated from the
423
- // associated TypeLocs or resynthesized as fresh typevars.
424
- if (auto *CE = dyn_cast<ClosureExpr>(expr))
425
- for (auto P : *CE->getParameters ()) {
426
- if (P->hasInterfaceType ()) {
427
- TS->ParamDeclInterfaceTypes [P] = P->getInterfaceType ();
428
- P->setInterfaceType (Type ());
429
- }
430
- }
431
419
432
420
expr->setType (nullptr );
433
421
@@ -470,12 +458,6 @@ namespace {
470
458
471
459
for (auto patternElt : PatternTypes)
472
460
patternElt.first ->setType (patternElt.second );
473
-
474
- for (auto paramDeclIfaceElt : ParamDeclInterfaceTypes) {
475
- assert (!paramDeclIfaceElt.first ->isImmutable () ||
476
- !paramDeclIfaceElt.second ->is <InOutType>());
477
- paramDeclIfaceElt.first ->setInterfaceType (paramDeclIfaceElt.second ->getInOutObjectType ());
478
- }
479
461
480
462
// Done, don't do redundant work on destruction.
481
463
ExprTypes.clear ();
@@ -502,33 +484,6 @@ namespace {
502
484
for (auto patternElt : PatternTypes)
503
485
if (!patternElt.first ->hasType ())
504
486
patternElt.first ->setType (patternElt.second );
505
-
506
- for (auto paramDeclIfaceElt : ParamDeclInterfaceTypes)
507
- if (!paramDeclIfaceElt.first ->hasInterfaceType ()) {
508
- paramDeclIfaceElt.first ->setInterfaceType (
509
- getParamBaseType (paramDeclIfaceElt));
510
- }
511
- }
512
-
513
- private:
514
- static Type getParamBaseType (std::pair<ParamDecl *, Type> &storedParam) {
515
- ParamDecl *param;
516
- Type storedType;
517
-
518
- std::tie (param, storedType) = storedParam;
519
-
520
- // FIXME: We are currently in process of removing `InOutType`
521
- // so `VarDecl::get{Interface}Type` is going to wrap base
522
- // type into `InOutType` if its flag indicates that it's
523
- // an `inout` parameter declaration. But such type can't
524
- // be restored directly using `VarDecl::set{Interface}Type`
525
- // caller needs additional logic to extract base type.
526
- if (auto *IOT = storedType->getAs <InOutType>()) {
527
- assert (param->isInOut ());
528
- return IOT->getObjectType ();
529
- }
530
-
531
- return storedType;
532
487
}
533
488
};
534
489
} // end anonymous namespace
0 commit comments