@@ -2601,61 +2601,3 @@ GenericSignature *ArchetypeBuilder::getGenericSignature() {
2601
2601
auto sig = GenericSignature::get (Impl->GenericParams , requirements);
2602
2602
return sig;
2603
2603
}
2604
-
2605
- void ArchetypeBuilder::expandGenericEnvironment (GenericEnvironment *env) {
2606
-
2607
- assert (Impl->finalized && " Must finalize builder first" );
2608
-
2609
- // Force the creation of all of the archetypes.
2610
- // FIXME: This isn't a well-formed notion with recursive protocol constraints.
2611
- auto signature = env->getGenericSignature ();
2612
- visitPotentialArchetypes ([&](PotentialArchetype *pa) {
2613
- if (auto archetype =
2614
- env->mapTypeIntoContext (
2615
- pa->getDependentType (signature->getGenericParams (),
2616
- /* allowUnresolved=*/ false ),
2617
- getLookupConformanceFn ())
2618
- ->getAs <ArchetypeType>())
2619
- (void )archetype->getAllNestedTypes ();
2620
- });
2621
-
2622
- #ifndef NDEBUG
2623
- // FIXME: This property should be maintained when there are errors, too.
2624
- if (!Diags.hadAnyError ()) {
2625
- auto genericParams = signature->getGenericParams ();
2626
- visitPotentialArchetypes ([&](PotentialArchetype *pa) {
2627
- if (pa->isConcreteType ()) return ;
2628
-
2629
- auto depTy = pa->getDependentType (genericParams,
2630
- /* allowUnresolved=*/ false );
2631
- auto inContext = env->mapTypeIntoContext (depTy, getLookupConformanceFn ());
2632
-
2633
- auto repDepTy = pa->getRepresentative ()->getDependentType (
2634
- genericParams,
2635
- /* allowUnresolved=*/ false );
2636
- auto repInContext =
2637
- env->mapTypeIntoContext (repDepTy, getLookupConformanceFn ());
2638
- if (!(inContext->isEqual (repInContext) ||
2639
- inContext->hasError () ||
2640
- repInContext->hasError ())) {
2641
- dump (llvm::errs ());
2642
-
2643
- llvm::errs () << " Dependent type:\n " ;
2644
- depTy->dump ();
2645
-
2646
- llvm::errs () << " Dependent type in context:\n " ;
2647
- inContext->dump ();
2648
-
2649
- llvm::errs () << " Representative dependent type:\n " ;
2650
- repDepTy->dump ();
2651
-
2652
- llvm::errs () << " Representative in context:\n " ;
2653
- repInContext->dump ();
2654
-
2655
- llvm_unreachable (
2656
- " Potential archetype mapping differs from representative!" );
2657
- }
2658
- });
2659
- }
2660
- #endif
2661
- }
0 commit comments