File tree Expand file tree Collapse file tree 4 files changed +17
-12
lines changed Expand file tree Collapse file tree 4 files changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -1949,18 +1949,6 @@ LookupConformanceInModuleRequest::evaluate(
1949
1949
return getBuiltinBuiltinTypeConformance (type, builtinType, protocol);
1950
1950
}
1951
1951
1952
- // Specific handling of Copyable and Sendable for pack expansions.
1953
- // FIXME: Remove.
1954
- if (auto packExpansion = type->getAs <PackExpansionType>()) {
1955
- if (protocol->isSpecificProtocol (KnownProtocolKind::Copyable) ||
1956
- protocol->isSpecificProtocol (KnownProtocolKind::Sendable)) {
1957
- auto patternType = packExpansion->getPatternType ();
1958
- return (patternType->isTypeParameter ()
1959
- ? ProtocolConformanceRef (protocol)
1960
- : mod->lookupConformance (patternType, protocol));
1961
- }
1962
- }
1963
-
1964
1952
auto nominal = type->getAnyNominal ();
1965
1953
1966
1954
// If we don't have a nominal type, there are no conformances.
Original file line number Diff line number Diff line change @@ -160,6 +160,10 @@ bool TypeBase::isPureMoveOnly() {
160
160
if (auto *nom = getAnyNominal ())
161
161
return nom->isMoveOnly ();
162
162
163
+ if (auto *expansion = getAs<PackExpansionType>()) {
164
+ return expansion->getPatternType ()->isPureMoveOnly ();
165
+ }
166
+
163
167
// if any components of the tuple are move-only, then the tuple is move-only.
164
168
if (auto *tupl = getCanonicalType ()->getAs <TupleType>()) {
165
169
for (auto eltTy : tupl->getElementTypes ())
Original file line number Diff line number Diff line change @@ -8293,6 +8293,17 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyConformsToConstraint(
8293
8293
return SolutionKind::Solved;
8294
8294
}
8295
8295
8296
+ // We sometimes get a pack expansion type here.
8297
+ if (auto *expansionType = type->getAs<PackExpansionType>()) {
8298
+ // FIXME: Locator
8299
+ addConstraint(ConstraintKind::ConformsTo,
8300
+ expansionType->getPatternType(),
8301
+ protocol->getDeclaredInterfaceType(),
8302
+ locator);
8303
+
8304
+ return SolutionKind::Solved;
8305
+ }
8306
+
8296
8307
// Copyable is checked structurally, so for better performance, split apart
8297
8308
// this constraint into individual Copyable constraints on each tuple element.
8298
8309
if (auto *tupleType = type->getAs<TupleType>()) {
Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ func useConformance() {
38
38
////
39
39
40
40
extension Builtin . TheTupleType : Equatable where repeat each Elements : Equatable {
41
+ // FIXME: Hack
42
+ @_disfavoredOverload
41
43
public static func == ( lhs: Self , rhs: Self ) -> Bool {
42
44
var result = true
43
45
func update< E: Equatable > ( lhs: E , rhs: E ) {
You can’t perform that action at this time.
0 commit comments