@@ -1713,9 +1713,6 @@ static ProtocolConformanceRef getBuiltinTupleTypeConformance(
1713
1713
ModuleDecl *module ) {
1714
1714
ASTContext &ctx = protocol->getASTContext ();
1715
1715
1716
- // This is the new code path.
1717
- //
1718
- // FIXME: Remove the Sendable stuff below.
1719
1716
auto *tupleDecl = ctx.getBuiltinTupleDecl ();
1720
1717
1721
1718
// Find the (unspecialized) conformance.
@@ -1748,62 +1745,6 @@ static ProtocolConformanceRef getBuiltinTupleTypeConformance(
1748
1745
return ProtocolConformanceRef (specialized);
1749
1746
}
1750
1747
1751
- // / For some known protocols (KPs) like Sendable and Copyable, a tuple type
1752
- // / conforms to the protocol KP when all of their element types conform to KP.
1753
- if (protocol->isSpecificProtocol (KnownProtocolKind::Sendable) ||
1754
- protocol->isSpecificProtocol (KnownProtocolKind::Copyable)) {
1755
-
1756
- // Create the pieces for a generic tuple type (T1, T2, ... TN) and a
1757
- // generic signature <T1, T2, ..., TN>.
1758
- SmallVector<GenericTypeParamType *, 4 > genericParams;
1759
- SmallVector<Type, 4 > typeSubstitutions;
1760
- SmallVector<TupleTypeElt, 4 > genericElements;
1761
- SmallVector<Requirement, 4 > conditionalRequirements;
1762
- for (const auto &elt : tupleType->getElements ()) {
1763
- auto genericParam = GenericTypeParamType::get (/* isParameterPack*/ false , 0 ,
1764
- genericParams.size (), ctx);
1765
- genericParams.push_back (genericParam);
1766
- typeSubstitutions.push_back (elt.getType ());
1767
- genericElements.push_back (elt.getWithType (genericParam));
1768
- conditionalRequirements.push_back (
1769
- Requirement (RequirementKind::Conformance, genericParam,
1770
- protocol->getDeclaredType ()));
1771
- }
1772
-
1773
- // If there were no generic parameters, just form the builtin conformance.
1774
- if (genericParams.empty ()) {
1775
- return ProtocolConformanceRef (
1776
- ctx.getBuiltinConformance (type, protocol, GenericSignature (), { },
1777
- BuiltinConformanceKind::Synthesized));
1778
- }
1779
-
1780
- // Form a generic conformance of (T1, T2, ..., TN): KP with signature
1781
- // <T1, T2, ..., TN> and conditional requirements T1: KP,
1782
- // T2: P, ..., TN: KP.
1783
- auto genericTupleType = TupleType::get (genericElements, ctx);
1784
- auto genericSig = GenericSignature::get (
1785
- genericParams, conditionalRequirements);
1786
- auto genericConformance = ctx.getBuiltinConformance (
1787
- genericTupleType, protocol, genericSig, conditionalRequirements,
1788
- BuiltinConformanceKind::Synthesized);
1789
-
1790
- // Compute the substitution map from the generic parameters of the
1791
- // generic conformance to actual types that were in the tuple type.
1792
- // Form a specialized conformance from that.
1793
- auto subMap = SubstitutionMap::get (
1794
- genericSig, [&](SubstitutableType *type) {
1795
- if (auto gp = dyn_cast<GenericTypeParamType>(type)) {
1796
- if (gp->getDepth () == 0 )
1797
- return typeSubstitutions[gp->getIndex ()];
1798
- }
1799
-
1800
- return Type (type);
1801
- },
1802
- LookUpConformanceInModule (module ));
1803
- return ProtocolConformanceRef (
1804
- ctx.getSpecializedConformance (type, genericConformance, subMap));
1805
- }
1806
-
1807
1748
return ProtocolConformanceRef::forMissingOrInvalid (type, protocol);
1808
1749
}
1809
1750
0 commit comments