mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
AST: Pass SubstFlags::PreservePackExpansionLevel in a few more places
This commit is contained in:
@@ -1633,7 +1633,9 @@ SwiftDeclCollector::constructTypeNode(Type T, TypeInitInfo Info) {
|
||||
ReplaceOpaqueTypesWithUnderlyingTypes replacer(
|
||||
/*inContext=*/nullptr, ResilienceExpansion::Maximal,
|
||||
/*isWholeModuleContext=*/false);
|
||||
T = T.subst(replacer, replacer, SubstFlags::SubstituteOpaqueArchetypes)
|
||||
T = T.subst(replacer, replacer,
|
||||
SubstFlags::SubstituteOpaqueArchetypes |
|
||||
SubstFlags::PreservePackExpansionLevel)
|
||||
->getCanonicalType();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1016,7 +1016,9 @@ static Type substOpaqueTypesWithUnderlyingTypesRec(
|
||||
llvm::DenseSet<ReplaceOpaqueTypesWithUnderlyingTypes::SeenDecl> &decls) {
|
||||
ReplaceOpaqueTypesWithUnderlyingTypes replacer(inContext, contextExpansion,
|
||||
isWholeModuleContext, decls);
|
||||
return ty.subst(replacer, replacer, SubstFlags::SubstituteOpaqueArchetypes);
|
||||
return ty.subst(replacer, replacer,
|
||||
SubstFlags::SubstituteOpaqueArchetypes |
|
||||
SubstFlags::PreservePackExpansionLevel);
|
||||
}
|
||||
|
||||
/// Checks that \p dc has access to \p ty for the purposes of an opaque
|
||||
@@ -1169,7 +1171,8 @@ static ProtocolConformanceRef substOpaqueTypesWithUnderlyingTypesRec(
|
||||
ReplaceOpaqueTypesWithUnderlyingTypes replacer(inContext, contextExpansion,
|
||||
isWholeModuleContext, decls);
|
||||
return ref.subst(origType, replacer, replacer,
|
||||
SubstFlags::SubstituteOpaqueArchetypes);
|
||||
SubstFlags::SubstituteOpaqueArchetypes |
|
||||
SubstFlags::PreservePackExpansionLevel);
|
||||
}
|
||||
|
||||
ProtocolConformanceRef swift::substOpaqueTypesWithUnderlyingTypes(
|
||||
|
||||
@@ -4800,14 +4800,16 @@ static bool areABICompatibleParamsOrReturns(SILType a, SILType b,
|
||||
if (aa.getASTType()->hasOpaqueArchetype())
|
||||
opaqueTypesSubstituted = aa.subst(inFunction->getModule(), replacer,
|
||||
replacer, CanGenericSignature(),
|
||||
SubstFlags::SubstituteOpaqueArchetypes);
|
||||
SubstFlags::SubstituteOpaqueArchetypes |
|
||||
SubstFlags::PreservePackExpansionLevel);
|
||||
|
||||
auto opaqueTypesSubstituted2 = bb;
|
||||
if (bb.getASTType()->hasOpaqueArchetype())
|
||||
opaqueTypesSubstituted2 =
|
||||
bb.subst(inFunction->getModule(), replacer, replacer,
|
||||
CanGenericSignature(),
|
||||
SubstFlags::SubstituteOpaqueArchetypes);
|
||||
SubstFlags::SubstituteOpaqueArchetypes |
|
||||
SubstFlags::PreservePackExpansionLevel);
|
||||
if (opaqueTypesSubstituted == opaqueTypesSubstituted2)
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user