@@ -506,6 +506,13 @@ struct TypeRefIsConcrete
506
506
}
507
507
508
508
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
+
509
516
return false ;
510
517
}
511
518
@@ -1350,15 +1357,12 @@ class TypeRefSubstitution
1350
1357
: public TypeRefVisitor<TypeRefSubstitution, const TypeRef *> {
1351
1358
TypeRefBuilder &Builder;
1352
1359
GenericArgumentMap Substitutions;
1353
- // Set true iff the Substitution map was actually used
1354
- bool DidSubstitute;
1360
+
1355
1361
public:
1356
1362
using TypeRefVisitor<TypeRefSubstitution, const TypeRef *>::visit;
1357
1363
1358
1364
TypeRefSubstitution (TypeRefBuilder &Builder, GenericArgumentMap Substitutions)
1359
- : Builder(Builder), Substitutions(Substitutions), DidSubstitute(false ) {}
1360
-
1361
- bool didSubstitute () const { return DidSubstitute; }
1365
+ : Builder(Builder), Substitutions(Substitutions) {}
1362
1366
1363
1367
const TypeRef *visitBuiltinTypeRef (const BuiltinTypeRef *B) {
1364
1368
return B;
@@ -1488,7 +1492,6 @@ class TypeRefSubstitution
1488
1492
if (found == Substitutions.end ())
1489
1493
return GTP;
1490
1494
assert (found->second ->isConcrete ());
1491
- DidSubstitute = true ; // We actually used the Substitutions
1492
1495
1493
1496
// When substituting a concrete type containing a metatype into a
1494
1497
// type parameter, (eg: T, T := C.Type), we must also represent
@@ -1609,15 +1612,6 @@ const TypeRef *TypeRef::subst(TypeRefBuilder &Builder,
1609
1612
return TypeRefSubstitution (Builder, Subs).visit (this );
1610
1613
}
1611
1614
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
-
1621
1615
bool TypeRef::deriveSubstitutions (GenericArgumentMap &Subs,
1622
1616
const TypeRef *OrigTR,
1623
1617
const TypeRef *SubstTR) {
0 commit comments