@@ -1875,14 +1875,13 @@ static bool isRetroactiveConformance(const RootProtocolConformance *root) {
1875
1875
// / Determine whether the given protocol conformance contains a retroactive
1876
1876
// / protocol conformance anywhere in it.
1877
1877
static bool containsRetroactiveConformance (
1878
- ProtocolConformanceRef conformanceRef,
1879
- ModuleDecl *module ) {
1878
+ ProtocolConformanceRef conformanceRef) {
1880
1879
if (!conformanceRef.isPack () && !conformanceRef.isConcrete ())
1881
1880
return false ;
1882
1881
1883
1882
if (conformanceRef.isPack ()) {
1884
1883
for (auto patternConf : conformanceRef.getPack ()->getPatternConformances ()) {
1885
- if (containsRetroactiveConformance (patternConf, module ))
1884
+ if (containsRetroactiveConformance (patternConf))
1886
1885
return true ;
1887
1886
}
1888
1887
@@ -1912,7 +1911,7 @@ static bool containsRetroactiveConformance(
1912
1911
// for indexing purposes.
1913
1912
continue ;
1914
1913
}
1915
- if (containsRetroactiveConformance (conformance, module )) {
1914
+ if (containsRetroactiveConformance (conformance)) {
1916
1915
return true ;
1917
1916
}
1918
1917
}
@@ -1921,8 +1920,7 @@ static bool containsRetroactiveConformance(
1921
1920
}
1922
1921
1923
1922
void ASTMangler::appendRetroactiveConformances (SubstitutionMap subMap,
1924
- GenericSignature sig,
1925
- ModuleDecl *fromModule) {
1923
+ GenericSignature sig) {
1926
1924
if (subMap.empty ()) return ;
1927
1925
1928
1926
unsigned numProtocolRequirements = 0 ;
@@ -1942,7 +1940,7 @@ void ASTMangler::appendRetroactiveConformances(SubstitutionMap subMap,
1942
1940
continue ;
1943
1941
1944
1942
// Skip non-retroactive conformances.
1945
- if (!containsRetroactiveConformance (conformance, fromModule ))
1943
+ if (!containsRetroactiveConformance (conformance))
1946
1944
continue ;
1947
1945
1948
1946
if (conformance.isConcrete ())
@@ -1972,7 +1970,7 @@ void ASTMangler::appendRetroactiveConformances(Type type, GenericSignature sig)
1972
1970
subMap = type->getContextSubstitutionMap (module , nominal);
1973
1971
}
1974
1972
1975
- appendRetroactiveConformances (subMap, sig, module );
1973
+ appendRetroactiveConformances (subMap, sig);
1976
1974
}
1977
1975
1978
1976
void ASTMangler::appendSymbolicExtendedExistentialType (
@@ -1995,11 +1993,7 @@ void ASTMangler::appendSymbolicExtendedExistentialType(
1995
1993
for (auto argType : genInfo.Generalization .getReplacementTypes ())
1996
1994
appendType (argType, sig, forDecl);
1997
1995
1998
- // What module should be used here? The existential isn't anchored
1999
- // to any given module; we should just treat conformances as
2000
- // retroactive if they're "objectively" retroactive.
2001
- appendRetroactiveConformances (genInfo.Generalization , sig,
2002
- /* from module*/ nullptr );
1996
+ appendRetroactiveConformances (genInfo.Generalization , sig);
2003
1997
}
2004
1998
2005
1999
appendOperator (" Xj" );
@@ -2190,7 +2184,7 @@ void ASTMangler::appendImplFunctionType(SILFunctionType *fn,
2190
2184
}
2191
2185
if (auto subs = fn->getInvocationSubstitutions ()) {
2192
2186
appendFlatGenericArgs (subs, sig, forDecl);
2193
- appendRetroactiveConformances (subs, sig, Mod );
2187
+ appendRetroactiveConformances (subs, sig);
2194
2188
}
2195
2189
if (auto subs = fn->getPatternSubstitutions ()) {
2196
2190
appendGenericSignature (subs.getGenericSignature ());
@@ -2199,7 +2193,7 @@ void ASTMangler::appendImplFunctionType(SILFunctionType *fn,
2199
2193
? fn->getInvocationGenericSignature ()
2200
2194
: outerGenericSig;
2201
2195
appendFlatGenericArgs (subs, sig, forDecl);
2202
- appendRetroactiveConformances (subs, sig, Mod );
2196
+ appendRetroactiveConformances (subs, sig);
2203
2197
}
2204
2198
2205
2199
OpArgs.push_back (' _' );
@@ -2235,7 +2229,7 @@ void ASTMangler::appendOpaqueTypeArchetype(ArchetypeType *archetype,
2235
2229
appendOpaqueDeclName (opaqueDecl);
2236
2230
bool isFirstArgList = true ;
2237
2231
appendBoundGenericArgs (opaqueDecl, sig, subs, isFirstArgList, forDecl);
2238
- appendRetroactiveConformances (subs, sig, opaqueDecl-> getParentModule () );
2232
+ appendRetroactiveConformances (subs, sig);
2239
2233
2240
2234
appendOperator (" Qo" , Index (genericParam->getIndex ()));
2241
2235
} else {
0 commit comments