@@ -506,6 +506,13 @@ struct TypeRefIsConcrete
506506 }
507507
508508 bool visitOpaqueArchetypeTypeRef (const OpaqueArchetypeTypeRef *O) {
509+ for (auto Args : O->getArgumentLists ()) {
510+ for (auto *Arg : Args) {
511+ if (!visit (Arg))
512+ return false ;
513+ }
514+ }
515+
509516 return false ;
510517 }
511518
@@ -1350,15 +1357,12 @@ class TypeRefSubstitution
13501357 : public TypeRefVisitor<TypeRefSubstitution, const TypeRef *> {
13511358 TypeRefBuilder &Builder;
13521359 GenericArgumentMap Substitutions;
1353- // Set true iff the Substitution map was actually used
1354- bool DidSubstitute;
1360+
13551361public:
13561362 using TypeRefVisitor<TypeRefSubstitution, const TypeRef *>::visit;
13571363
13581364 TypeRefSubstitution (TypeRefBuilder &Builder, GenericArgumentMap Substitutions)
1359- : Builder(Builder), Substitutions(Substitutions), DidSubstitute(false ) {}
1360-
1361- bool didSubstitute () const { return DidSubstitute; }
1365+ : Builder(Builder), Substitutions(Substitutions) {}
13621366
13631367 const TypeRef *visitBuiltinTypeRef (const BuiltinTypeRef *B) {
13641368 return B;
@@ -1488,7 +1492,6 @@ class TypeRefSubstitution
14881492 if (found == Substitutions.end ())
14891493 return GTP;
14901494 assert (found->second ->isConcrete ());
1491- DidSubstitute = true ; // We actually used the Substitutions
14921495
14931496 // When substituting a concrete type containing a metatype into a
14941497 // type parameter, (eg: T, T := C.Type), we must also represent
@@ -1609,15 +1612,6 @@ const TypeRef *TypeRef::subst(TypeRefBuilder &Builder,
16091612 return TypeRefSubstitution (Builder, Subs).visit (this );
16101613}
16111614
1612- const TypeRef *TypeRef::subst (TypeRefBuilder &Builder,
1613- const GenericArgumentMap &Subs,
1614- bool &DidSubstitute) const {
1615- auto subst = TypeRefSubstitution (Builder, Subs);
1616- auto TR = subst.visit (this );
1617- DidSubstitute = subst.didSubstitute ();
1618- return TR;
1619- }
1620-
16211615bool TypeRef::deriveSubstitutions (GenericArgumentMap &Subs,
16221616 const TypeRef *OrigTR,
16231617 const TypeRef *SubstTR) {
0 commit comments