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(
|
ReplaceOpaqueTypesWithUnderlyingTypes replacer(
|
||||||
/*inContext=*/nullptr, ResilienceExpansion::Maximal,
|
/*inContext=*/nullptr, ResilienceExpansion::Maximal,
|
||||||
/*isWholeModuleContext=*/false);
|
/*isWholeModuleContext=*/false);
|
||||||
T = T.subst(replacer, replacer, SubstFlags::SubstituteOpaqueArchetypes)
|
T = T.subst(replacer, replacer,
|
||||||
|
SubstFlags::SubstituteOpaqueArchetypes |
|
||||||
|
SubstFlags::PreservePackExpansionLevel)
|
||||||
->getCanonicalType();
|
->getCanonicalType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1016,7 +1016,9 @@ static Type substOpaqueTypesWithUnderlyingTypesRec(
|
|||||||
llvm::DenseSet<ReplaceOpaqueTypesWithUnderlyingTypes::SeenDecl> &decls) {
|
llvm::DenseSet<ReplaceOpaqueTypesWithUnderlyingTypes::SeenDecl> &decls) {
|
||||||
ReplaceOpaqueTypesWithUnderlyingTypes replacer(inContext, contextExpansion,
|
ReplaceOpaqueTypesWithUnderlyingTypes replacer(inContext, contextExpansion,
|
||||||
isWholeModuleContext, decls);
|
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
|
/// 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,
|
ReplaceOpaqueTypesWithUnderlyingTypes replacer(inContext, contextExpansion,
|
||||||
isWholeModuleContext, decls);
|
isWholeModuleContext, decls);
|
||||||
return ref.subst(origType, replacer, replacer,
|
return ref.subst(origType, replacer, replacer,
|
||||||
SubstFlags::SubstituteOpaqueArchetypes);
|
SubstFlags::SubstituteOpaqueArchetypes |
|
||||||
|
SubstFlags::PreservePackExpansionLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
ProtocolConformanceRef swift::substOpaqueTypesWithUnderlyingTypes(
|
ProtocolConformanceRef swift::substOpaqueTypesWithUnderlyingTypes(
|
||||||
|
|||||||
@@ -4800,14 +4800,16 @@ static bool areABICompatibleParamsOrReturns(SILType a, SILType b,
|
|||||||
if (aa.getASTType()->hasOpaqueArchetype())
|
if (aa.getASTType()->hasOpaqueArchetype())
|
||||||
opaqueTypesSubstituted = aa.subst(inFunction->getModule(), replacer,
|
opaqueTypesSubstituted = aa.subst(inFunction->getModule(), replacer,
|
||||||
replacer, CanGenericSignature(),
|
replacer, CanGenericSignature(),
|
||||||
SubstFlags::SubstituteOpaqueArchetypes);
|
SubstFlags::SubstituteOpaqueArchetypes |
|
||||||
|
SubstFlags::PreservePackExpansionLevel);
|
||||||
|
|
||||||
auto opaqueTypesSubstituted2 = bb;
|
auto opaqueTypesSubstituted2 = bb;
|
||||||
if (bb.getASTType()->hasOpaqueArchetype())
|
if (bb.getASTType()->hasOpaqueArchetype())
|
||||||
opaqueTypesSubstituted2 =
|
opaqueTypesSubstituted2 =
|
||||||
bb.subst(inFunction->getModule(), replacer, replacer,
|
bb.subst(inFunction->getModule(), replacer, replacer,
|
||||||
CanGenericSignature(),
|
CanGenericSignature(),
|
||||||
SubstFlags::SubstituteOpaqueArchetypes);
|
SubstFlags::SubstituteOpaqueArchetypes |
|
||||||
|
SubstFlags::PreservePackExpansionLevel);
|
||||||
if (opaqueTypesSubstituted == opaqueTypesSubstituted2)
|
if (opaqueTypesSubstituted == opaqueTypesSubstituted2)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user